Skip to main content

for_loop

Internal beta โ€” config shape is being migrated

The Automation API is an internal beta and is not released yet โ€” endpoints and payloads may change or be withdrawn without notice. This action's config is being migrated to a typed schema; the fields below reflect that in-progress shape. Always read the authoritative, live shape from GET /v1/automation/meta/action before building against it.

For loop โ€” iterates over an iterable and runs a nested body of actions for each item. group: "control_flow". No specific trigger context is required. This is a control-flow action: its whole shape now lives in config (recently moved from the action's top level), and each branch is enabled by presence โ€” there are no *_enabled flags.

Part of the Flow control family. This page documents the typed config; for how an action sits inside an automation definition, see Actions and Action examples.

Configโ€‹

KeyTypeRequiredDescription
iterablereferencenoThe collection to loop over โ€” a record_collection reference produced by an upstream collect_* action (or a multi-value field / custom variable). Named iterable on the wire (renamed from the internal iterable_variable_def).
action_rowsarray of nested actionsnoThe loop body โ€” the actions run once per item. Empty when omitted.
break_conditionfilter group | nullnoStops the loop when it matches. Omitted โ†’ disabled.
continue_conditionfilter group | nullnoSkips to the next item when it matches. Omitted โ†’ disabled.

Exampleโ€‹

An action entry inside an automation definition's actions[]:

{
"type": "for_loop",
"config": {
"iterable": { "kind": "variable", "source": "action", "action_type": "record_collection", "app_id": 12345 },
"action_rows": [
{
"type": "send_email",
"config": {
"to_address": ["[email protected]"],
"subject": ["Processing item"]
}
}
]
}
}

Validation & behaviorโ€‹

  • No member is required โ€” an empty config is valid, though a loop with no iterable or action_rows does nothing useful.
  • Control-flow shape lives entirely in config; it was recently moved from the action's top level.
  • Enabled-ness is encoded by presence, not by a flag: an omitted break_condition or continue_condition disables that branch (the internal *_enabled members are derived).
  • action_rows holds nested actions that execute once per iteration; break_condition / continue_condition are evaluated as filter groups.

See alsoโ€‹