flow_execute()
Run another on-demand flow, optionally passing it a record. Lets you build reusable flows and call them from several places.
Syntax
flow_execute(table, flow, recordId, throwOnError?)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
table |
string | yes | Table name or id the target flow is attached to. |
flow |
int | string | yes | The target flow's id, or its name. |
recordId |
int | array | yes | A record id (or $record), or 0/null to run with no record. |
throwOnError |
bool | no | If true, errors from the called flow propagate. Default false. |
Returns
true on success, false if the called flow errored and throwOnError is false.
Example
// Re-use a "Send welcome pack" on-demand flow for this new customer.
flow_execute("customers", "Send welcome pack", $record["_meta"]["id"]);
Example output
true
Notes
- The target flow must be active, of type On Demand, and attached to
table. tablemust be in this flow's workspace scope.- The record is optional — pass
0ornullto run a flow that doesn't need a{{record.*}}. - Recursion is guarded (max 5 deep, with cycle detection).
- Passing a name that matches more than one flow throws — use the flow id to disambiguate.
See also: flow_url(), Automations