When to use a section
Use a section when the same steps appear in more than one workflow and you want one place to change them: a vendor lookup, a totals reconciliation, a compliance check. Use a Forward output instead when you want to hand the document to a different workflow that owns the next stage of its life. Forwarding creates a new document with its own run; calling keeps one document and one run.Build the section
- Create a workflow for the section
- Add a Sub-workflow trigger and declare its input contract: the fields callers must supply. Leave it with no fields if the section only needs the document
- Build the steps
- If the caller should continue with the section’s data, add a Return node, declare its return contract, and map the section’s outputs into it
- Converge every branch that should hand something back into that single return; a section ending in its own output (for example a connector) needs no return, its caller’s call completes with an empty payload, and the call node may end the caller’s branch outright
Convert existing steps into a section
If the steps already exist inline in a workflow, you do not have to rebuild them. Select them on the canvas and convert them into a section directly.- Select whole branches. The selection needs a single entry point and a single exit point, and the exit must leave from one output port.
- Open Convert to section. Ingestly reads every reference crossing the edge of your selection and shows you the input and return contracts it derives, before you commit to anything:
- A value a selected step reads from a step outside the selection becomes an input.
- A value a step outside the selection reads from a selected step becomes a return.
- Name the section and confirm.
Some selections cannot convert, and Ingestly names exactly what to fix. Common reasons: the selection contains a trigger, is not one connected group, has more than one entry or exit, leaves from an error port, splits a loop body from its loop container, or branches (an If or a Switch) on a step outside the selection. A Transform or Validation script that reads across the boundary is rewritten automatically where that is safe, and refused by name when it is not. Validate rules are rewritten too: a rule that checks a value from outside the selection becomes an input, and a rule outside that checks a value the section produces reads it back from the call.
Call it
- In the calling workflow, add a Call workflow action
- Pick the section. Only callable workflows in the same environment appear, and never the workflow you are editing
- Fill the mapping rows the section’s input contract created
- Continue building after the call. Nodes placed after it can read the section’s return fields, for example
{{Call section.payload.data.total}}
How a call runs
The section runs as a sub-run of the calling run, on the same document. No copy of the document is made.- The call always waits for the section and then continues with its result
- Top-level run lists show one entry for the whole thing, not one per section
- The calling run’s detail nests the section under the call step, named after the workflow it ran, so you can open it and read its steps
- If the section fails, the calling step fails with the section’s error and a link to its run
- If the section finishes without reaching its return, the calling step fails: nothing was produced
Reviews inside a section
A section can contain a Review action. The call waits for the reviewer, with no timeout: the wait is durable and survives restarts. The caller’s run detail marks the section in review, so a section parked on a person is visible from the calling run without opening it.Limits
A workflow cannot call itself, and Ingestly rejects a call chain that comes back around (A calls B, B calls A) when you save. A runtime depth cap of 10 backs that up, so a chain assembled by editing several workflows separately still stops.Credits
The three section nodes are free: the call, the sub-workflow trigger and the return. The section’s other steps bill normally, on the section’s own run. Calling a section costs the same as the steps would have cost inline.Changing a contract
Both contracts are interfaces, so changing one affects the workflows on the other side.- Change the input contract and callers whose mappings no longer satisfy it are flagged and disabled when you save, until their mappings are fixed
- Change the return contract and callers reading a removed field are left pointing at nothing
Related
Call workflow action
Run a section and use its result
Sub-workflow trigger
Declare what a section needs
Return output
Declare what a section hands back
Forward output
Hand the document off instead