agently-triggerflow-subflows
Agently TriggerFlow Subflows
This skill covers TriggerFlow sub flows in Agently. It focuses on to_sub_flow(...), parent-child data handoff through capture and write_back, isolated child state, resource handoff, runtime-stream bridging, and the current sub-flow limits. It does not cover generic branching or batching, model-request details, interrupt handling as a standalone topic, flow-config export/import, or execution-state persistence.
Prerequisite: Agently >= 4.0.8.5.
Scope
Use this skill for:
to_sub_flow(...)- deciding when a child workflow should be isolated instead of inlined
capturefrom parentvalue,runtime_data,flow_data, and resourceswrite_backinto parentvalue,runtime_data, andflow_data- child-flow state isolation from the parent and from the reusable child template
- parent runtime-stream visibility for child stream events
- current sub-flow limits such as child pause/resume support
Do not use this skill for:
- ordinary linear flow construction, branching,
batch(...),for_each(...), orcollect(...) - provider setup or model configuration
- model requests inside chunks as the main problem
- explicit interrupt design outside the sub-flow boundary
- flow config export/import or Mermaid generation
- execution save/load or resume-after-restart persistence
Workflow
- Start with references/subflow-boundaries.md to decide whether the workflow should stay inline or become an isolated child flow.
- If the task is about parent-child data handoff, read references/capture-and-write-back.md.
- If the task is about child state isolation, stream propagation, or current limits, read references/isolation-stream-and-limits.md.
- If the task is about exporting or restoring a flow definition that already contains sub flows, switch to
agently-triggerflow-config. - If the task is about child waiting, external re-entry, or human approval, switch to
agently-triggerflow-interrupts-and-stream. - If behavior still looks wrong, use references/troubleshooting.md.
Core Mental Model
A sub flow is a function-like child workflow boundary inside TriggerFlow.
- the parent decides what to pass in through
capture - the child runs as its own isolated execution
- the parent only gets changes back through explicit
write_back
Use a sub flow when nested workflow structure and explicit parent-child boundaries matter more than keeping everything inline in one flow.
Selection Rules
- one nested workflow should behave like a reusable isolated unit ->
to_sub_flow(...) - parent input or state must be copied into the child explicitly ->
capture - child result or child-derived state must be written back explicitly ->
write_back - child needs parent resources such as logger or service client -> capture resources into the child
- child stream events should surface in the parent execution stream -> use a sub flow and consume the parent runtime stream
- child workflow may pause for human input or external resume -> do not use sub flow as the final design; move to
agently-triggerflow-interrupts-and-stream - exporting, loading, or visualizing a flow that contains sub flows -> combine with
agently-triggerflow-config
Important Boundaries
capturecopies selected parent data; it is not a live shared reference contractwrite_backis explicit; child changes do not automatically mutate the parent- child
flow_datais isolated from the reusable child-flow template unless written back - child runtime stream events are bridged into the parent runtime stream
- child pause/resume and external re-entry are not supported through
to_sub_flow(...)in the current runtime
References
references/source-map.mdreferences/subflow-boundaries.mdreferences/capture-and-write-back.mdreferences/isolation-stream-and-limits.mdreferences/troubleshooting.md
More from agentera/agently-skills
agently-playbook
Use when the user wants to build, initialize, validate, optimize, or refactor a model-powered assistant, internal tool, automation, evaluator, or workflow from a business scenario or common problem statement, including project-structure refactors or starter skeletons that may separate model setup, prompt config, and orchestration, even if the request also mentions a UI, app shell, or local model service such as Ollama, and it is still unclear whether the solution should stay a single request, add supporting capabilities, or become orchestration. The user does not need to mention Agently explicitly.
27agently-prompt-management
Use when the user is shaping how one model request or request family should be instructed or templated, including prompt slots, input/instruct/info layering, mappings, recursive placeholder injection, prompt config, YAML or config-file-driven prompt behavior, and reusable prompt structure.
27agently-model-setup
Use when the request is already narrowed to wiring a model endpoint, env vars, settings-file-based model config, `${ENV.xxx}` placeholders, `auto_load_env=True`, or connectivity check for a model-powered feature, including local Ollama, dotenv-loaded DeepSeek or other OpenAI-compatible settings, plugin namespace placement, auth, request options, and minimal verification.
27agently-langchain-to-agently
Use when a migration is already known to stay on the LangChain agent side, including agent setup, tools, structured output, retrieval, and short-term memory.
25agently-triggerflow
Use when the user needs workflow orchestration such as branching, concurrency, approvals, waiting and resume, runtime stream, restart-safe execution, mixed sync/async function or module orchestration, event-driven fan-out, process-clarity refactors that make stages explicit, performance-oriented refactors that collapse split requests, or workflow definitions and chunk-level runtime metadata that must stay visible for debugging and visualization. The user does not need to say TriggerFlow explicitly.
25agently-output-control
Use when the user wants stable structured fields, required keys, reliable machine-readable sections, or downstream-consumable output from one model request, including prompt-config-owned output contracts, `.output(...)`, field ordering, `ensure_keys`, and structured streaming.
25