cropped-SlicedBread_icon_inversed.png

3.1. Scheduling & Automation

Recipe automation is handled through a variety of native tools, from Flow and Apex to advanced, configurable Recipe Jobs. This provides a flexible and powerful way to integrate Sliced Bread into your existing business logic.

3.1.1. Automating with Salesforce Flow #

The most common way to automate a recipe is by using a Salesforce Flow to create a “Bread” record.

  • Create Bread Record: Use the “Create Record” element in Flow to insert a new Bread__c record. Populating the Recipe_Name__c field with the name of your recipe will automatically trigger the execution.

3.1.2. Automating with Apex #

For complex integrations, you can invoke recipes directly from your own custom Apex code.

  • Creating Bread Records: The primary method for triggering a recipe via Apex is to programmatically insert a Bread__c record with the specific recipe name.
  • slicedbread.Api.scheduleRecipe: This method exists for legacy support but should not be used for new implementations. Please use Recipe Jobs for scheduling recipes. (ref: 1.101)

3.1.3. Connected Systems (FTP/SFTP & Remote Orgs) #

The “Connected Systems” framework is a foundational feature that allows Sliced Bread to securely authenticate and interact with external systems. This is the prerequisite for advanced import and export automation.

  • Configuration: You can configure new connections from the Sliced Bread admin panel.
  • Supported Systems:
    • FTP/SFTP Servers: Allows recipes to read files from or export files to an SFTP server. This is the basis for the “Export to SFTP” target option (see Section 2.5.2). (ref: 1.154, 1.178)
    • AWS S3: Connects directly to an Amazon S3 bucket to retrieve or export files.
    • Remote Salesforce Orgs: Allows you to connect to other Salesforce orgs. This is the basis for the “Remote Query” feature and the “Multi-Org Monitoring” dashboard. (ref: 1.179)

3.1.4. Advanced Recipe Jobs #

For robust, recurring automation, you can configure “Recipe Jobs.” These provide fine-grained control over scheduling and execution behavior.

  • Auto Repeat: You can schedule a job to run at a recurring interval, such as “every 30 minutes.” (ref: 1.191)
  • Job Overlap Policy: You can define what happens if a new job is scheduled to start while the previous run is still in progress (e.g., “Skip” or “Queue”). (ref: 1.162)
  • Decompress File: Supports the automatic decompression of .zip and .gz files sourced from file systems like S3 or SFTP. (ref: 1.162)
  • Remote Query: When used with a “Connected System” pointing to another Salesforce org, this allows a recipe to run a SOQL query against the remote org as its data source. (ref: 1.179)

3.1.5. Recipe Chaining (Next Bread) #

For complex, multi-step data pipelines, you can chain recipes together. The “Next Bread” field on a recipe (see Section 2.5.1, “Run Another Recipe”) allows you to specify another recipe to run after the current one successfully finishes.

This creates a powerful, dependent sequence of operations. For example, you could have a “Master” recipe that slices a list of shops, and for each shop, it calls a “Child” recipe (Next Bread) to process all the books within that specific shop, passing the Shop ID as a parameter. (ref: 1.121)

Copyright © 2024 all rights reserved, powered by Sliced Bread Software B.V.