About scheduled and child Flows
In some cases, such as when you are working with lists, you will need a Flow to call another Flow. Such Flow pairs are referred to as a "parent Flow" (the caller) and "child Flow" (the Flow being called). Once the child Flow is called by the parent, it becomes active and runs. Otherwise, it remains inactive.
- About scheduled Flow events
- Use cases for child Flows
- Outputs from child Flows
- About using child Flows with List functions
About scheduled Flow events
A Scheduled Flow event is used to run on a schedule, such as once an hour, 5pm on Fridays, or at 9am on the first day of every month.
Adding a Scheduled Flow event prompts you to provide the schedule details. You can change the schedule by clicking the clock icon at the bottom of the card. Note that you can similarly adjust the schedule of most application events. For example, you can set a Salesforce - New Record event to check for new records every Friday at 5pm rather than every 5 minutes.
The schedule goes into effect only after the Flow has been turned on.
Each Scheduled Flow card has the following outputs:
-
Current Time - the date and time that the current instance of the Flow was initiated (in ISO UTC format). This can be passed to any text or date & time input.
-
Execution ID - the unique ID of the Flow instance.
Use cases for child Flows
Child Flows are useful in these scenarios:
-
You have a series of steps that get used more than once in a single Flow or across multiple Flows. By moving that series of steps into their own "child Flow" you created them just once bit can use them repeatedly. You run the steps from other Flows by using the Call Flow or Call Flow Async functions.
-
You want to process a list, one item at a time. For example, you can run a series of steps on each list item using the For Each function or you can transform a list into a new list (one item at a time) using the Map function.
-
You just want to break a very large Flow into smaller, more manageable parts.
Outputs from child Flows
Each Child Flow card has the following outputs:
-
Inputs to this Flow: Click to create custom fields, one at a time. Give each a name and data type (such as Text or Number). Each custom field you create corresponds to an expected input from any Flow that calls your child Flow.
-
Context : The outputs in this section are automatically assigned values every time the Flow runs:
-
Index - This number output is assigned a value when the Flow is called from a function that loops through the items of a list (such as the For Each or Map functions). The value of Index corresponds to the item's position in the list (starting with zero) processed by this particular instance of the Flow.
-
Caller - The keys of the Caller object tell you which Flow called the child Flow (id and name), which particular execution of the Flow made the call (execution_id), and which particular step in the Flow (method, which is an unique ID). When the child Flow is manually run, then id and execution_id are null. This is especially useful for debugging purposes.
-
Error - This object output is assigned a value when the Flow is called for error handling. See Set error handling for cards in Flows. The value of Error corresponds to the raw error object returns by the application or action that caused the error. For example, an object that will often have keys that include "message", "statusCode" and "execution" (the unique identifier of the Flow execution that caused the error, which can be used to construct a URL to the execution history that shows the Flow details that led to the error).
-
Execution ID - the unique ID of the Flow instance.
-

Note
A child Flow must be turned on before it can be called by other Flows.
Child Flows don't count towards your Active Flow limit since they are directly dependent on other Flows.
About using child Flows with List functions
Child Flows are helpful for List Functions because they allow you to go through each item of a list. These child Flows can have inputs that correspond to the type of item in the list, function perform a task on each item, and a return (found in the Control category).
For example, you can convert an object into a list of objects, where each key/value pair is converted to object that has propertyname
and propertyvalue
keys. This is a common pattern among cloud APIs. The propertyname
also needs to be prefixed with custom:
. You can do that with a child Flow. It accepts key, value, and a constant prefix (which is the same across all iterations; the parent Flow passes this in), and returns back an object with two keys.
That Flow, when used with object.map, will turn this object:
{"this":"that","up":"down","left":"right"}
into this:
[
{
"propertyname":"custom:this",
"propertyvalue":"that"
},
{
"propertyname":"custom:up",
"propertyvalue":"down"
},
{
"propertyname":"custom:left",
"propertyvalue":"right"
}
]