agently-triggerflow-state-and-resources
Agently TriggerFlow State And Resources
This skill covers TriggerFlow runtime state placement and runtime-only dependency design in Agently. It focuses on runtime_data versus flow_data, flow-level versus execution-level runtime resources, execution-scoped data.set_resource(...), what survives execution save/load, what does not, and how state or resources cross sub-flow boundaries. It does not cover generic branching patterns, model requests, interrupts as a standalone topic, flow-config export/import, or the mechanics of execution restore.
Prerequisite: Agently >= 4.0.8.5.
Scope
Use this skill for:
- choosing between
runtime_data/data.stateandflow_data/data.flow_state - deciding whether a dependency should be a flow-level or execution-level runtime resource
data.set_resource(...)and execution-scoped resource injection- understanding what execution save/load captures and what it does not
- understanding what flow-config export/import keeps and what it does not
- restart-safe state and resource design
- deciding how state and resources should cross a sub-flow boundary
Do not use this skill for:
- ordinary flow structure such as
when(...),batch(...),for_each(...), orcollect(...) to_sub_flow(...),capture, andwrite_backas the main topic- model-provider setup or model-call design
pause_for(...),continue_with(...), or runtime-stream lifecycle- the mechanics of
execution.save()/execution.load()and resume-after-restore
Workflow
- Start with references/state-placement.md to choose between
runtime_dataandflow_data. - If the task is about resource injection, overrides, or
data.set_resource(...), read references/resources-and-overrides.md. - If the task is about restart-safe design, save/load boundaries, or what must be re-injected, read references/persistence-boundaries.md.
- If the task is about nested parent-child state or resource handoff, read references/subflow-boundaries.md.
- If the task is about actual save/load and resume mechanics, switch to
agently-triggerflow-execution-state. - If behavior still looks wrong, use references/troubleshooting.md.
Core Mental Model
TriggerFlow has three different runtime surfaces:
runtime_datafor one execution onlyflow_datafor shared flow-level state- runtime resources for non-serializable dependencies
Choosing the wrong surface causes most real-world TriggerFlow state bugs:
- request-local values accidentally leak across executions
- shared flags accidentally disappear because they were stored in execution state
- restored executions fail because runtime resources were never re-injected
Selection Rules
- request-local context, per-run intermediate values, or one execution's working state ->
runtime_data - shared flags or values that later executions of the same flow should see ->
flow_data - logger, client, service object, renderer, or helper callable -> runtime resources
- one execution should override a flow default resource -> execution-level
runtime_resources=... - a handler creates a temporary resource for the current run only ->
data.set_resource(...) - a saved execution should resume after restart -> combine with
agently-triggerflow-execution-state - state or resources must cross parent-child flow boundaries -> combine with
agently-triggerflow-subflows - long-lived memory outside the TriggerFlow runtime itself -> use external persistence or
agently-session-memo, notflow_data
Important Boundaries
runtime_datais execution-scoped and should not be used for cross-execution sharingflow_datais shared on one flow object and may be visible to later executions of the same flow- runtime resources are not serialized into execution state or flow config; only resource-key expectations survive
- flow config export/import preserves the need for resources, not the resource objects themselves
- sub flows only receive the state or resources that are explicitly captured into them
References
references/source-map.mdreferences/state-placement.mdreferences/resources-and-overrides.mdreferences/persistence-boundaries.mdreferences/subflow-boundaries.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.
37agently-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.
37agently-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.
37agently-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.
35agently-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.
35agently-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.
35