How do I set up the Sub-flow step?

Build a part you repeat in several agents once, and call it from other agents.

What is it for?

“Sub-flow” runs the agent you choose at exactly this point; when that agent finishes, the flow continues from this step's exit. It's ideal for parts you repeat in several agents (collecting contact details, verifying identity): you build the part once and make changes in one place.

The step itself is invisible to visitors; they see the called flow's steps as part of the main flow.

To add it, click “Add step” on the “Flow” tab, then click “Sub-flow” in the “Logic” category; the step is added in the middle of the canvas. Its settings are on the “Content” tab of the step panel that opens on the right when you click the step.

This step has no “On-screen text”; instead there's a “Step note” at the bottom of the panel. The note is just for you: visitors don't see it, and it isn't spoken or translated.

Setting up the step

  1. Build the shared part as a separate agent and save it.
  2. Add a Sub-flow step to the main flow and choose that agent in “Agent to run”. To edit the chosen agent, click “Open the agent in a new tab”; unsaved work in the editor isn't lost.
  3. Connect the step's exit to the step to go to once the sub-flow finishes.

Good to know

  • The list only has agents from the same workspace. An agent can't call itself, and at most 3 sub-flows run nested.
  • Variables are shared: the main flow's variables can be used in the sub-flow, and answers given in the sub-flow can be used in the main flow's later steps.
  • End steps in the sub-flow don't end the conversation; they return to the main flow and their closing sentence isn't spoken. Steps in the sub-flow whose exit isn't connected return to the main flow too.
  • The sub-flow's last published version runs (its last saved state if it was never published), in Preview too. Changes you make in the sub-flow reach the main flow when you publish the sub-flow.
  • The page design and avatar are the main flow's. The sub-flow's texts come from its own translations, so translate the sub-flow into the main flow's languages as well.
  • If the chosen agent is deleted, the step is skipped and the flow moves on to the next step; the editor warns “No agent to run is chosen, or it no longer exists.”

Example

An agent called “Get contact details” has a Form (name, phone, email) and a Summary and confirmation step. Your booking, quote and complaint agents all call it with a Sub-flow step; their later steps use variables like {phone} directly.

Related articles

Was this article helpful?

Agenola and our partners use cookies to improve the site and show you relevant ads. We count which of our ads bring visitors without using your name or email; anything more only happens if you allow it. Privacy Policy(opens in a new tab)