Agently triggerflow

From AgentEra/Agently-Skills · View interactive version

Agently triggerflow is an AI agent skill from the GitHub repository AgentEra/Agently-Skills. Use when developer-owned execution needs inspectable branching, concurrency, joins, waits, approval, retry, runtime streams, pause/resume, recovery, or mixed sync/async orchestration. Use agently-stage instead when a provider-owned sync wrapper only bridges an async SDK.

How to use this skill

Skill file

Agently TriggerFlow

First use: read-only version check

Once per conversation across this package, read only sources from the sibling

skill-root .agently-skills-ui.json. Use only records for the official repository

with valid Git tree hashes and skills actually installed. With an already permitted

network tool, make at most one anonymous GET to

https://api.github.com/repos/AgentEra/Agently-Skills/contents/skills?ref=main.

Compare each installed skill's recorded tree with its directory sha; reuse

this result across skills and resumed context. Without usable records, skip the

request. Use a short timeout and bounded response when supported (6 s / 64 KB);

if unavailable or malformed, skip. Do not load or execute remote skill bodies.

Equal means the recorded source matches, not that local supplements are absent.

On a difference, briefly ask once whether to update or keep the current version;

a different hash alone does not prove a development checkout is older. Continue

using the installed version until explicitly approved. If declined, do not ask

again in this conversation. Missing records, offline access, failure or extra

permission requirements mean unknown: skip without retry or blocking the task.

Stay silent on a match; mention unknown only if relevant or asked. Never install

a checker, write a check cache, schedule work, obtain credentials or request extra

permissions for this check. Preserve local changes when an update is approved.

Use TriggerFlow when the application owns visible multi-stage execution

semantics. Use ModelRequest/AgentExecution for one bounded request/run, and use

agent.create_task(...) when one Agent owns a long task's planning, evidence,

verification, and repair without application-authored stage topology.

Read by Need

references/overview.md.

references/recovery.md.

references/runtime-intervention.md.

../agently-agentic-design/references/execution-topology-validation.md.

agently-stage.

Topology First

Before implementation, map:

Use batch(...), for_each(...), when(...), and managed emits to make

fan-out and joins graph-visible. Represent repetition with an explicit back

edge; do not hide lifecycle, retry, or revision loops inside while True chunk

handlers.

A ModelRequest is a dispatch-time snapshot. instant output may update UI or

start idempotent/cancelable preparation, but a later model request that needs

the resulting observation must start after a visible join and validation

barrier.

Graph adjacency proves activation, not value transfer. For audits, trace exact

values, signals, refs, and consumers through ModelRequest, Action, subflow,

TaskWorkspace/RecordStore, wait/resume, repair, and terminal boundaries.

Lifecycle and State

boundary. A synchronous provider facade may use Agently-Stage internally;

route direct bridge questions to agently-stage.

runs whose caller needs no execution handle.

save/load, intervention, inspection, cancellation, or host-controlled close.

Close drains execution-managed nowait work and reports unresolved ownership.

a data.is_resume branch; a suspended Python frame is not the recovery

contract.

emit, and stream methods. Setters replace the complete value; append only for

intentional list accumulation.

copy of that shared value; it does not provide isolation, CAS, merge, or

concurrency safety.

host storage owns business persistence. Keep compact refs/status in execution

state and full bodies cold.

Concurrency, Waits, and Streams

batch(..., concurrency=N) and for_each(..., concurrency=N) bound local

fan-out.

separate pressure owners.

asyncio.create_task(...); execution close settles registered work.

intervention only for optional context at declared boundaries.

UI/webhook/queue transport; TriggerFlow owns the interrupt/resume ledger.

raw parser paths as the frontend protocol, and reconcile provisional items

against final validated output.

Recovery and Dynamic-Graph Boundary

Save/load owns TriggerFlow progress and declared recovery metadata, not live

clients, callbacks, semaphores, coroutine frames, secrets, or external session

state. Restore live ExecutionResources through host/plugin resolvers and verify

external refs, versions, leases, and fence tokens before readiness. A local

RecordStore proves local restart only; do not claim distributed recovery

without a real shared provider and operational evidence.

Define developer-owned stable topology directly in importable TriggerFlow

modules with top-level handlers. Explicit submitted or model-generated DAG

data is a low-frequency TaskDAG case; read

../agently/references/task-dag.md. Never compile unvalidated runtime plan data

into ad hoc TriggerFlow definitions.

API Shape

from agently import Agently, TriggerFlow

flow = TriggerFlow(name="workflow-name")
factory_flow = Agently.create_trigger_flow("factory-workflow")
execution = flow.create_execution(auto_close=False)

when, emit_nowait, and pause_for are flow/runtime methods, not top-level

imports. Do not use @flow.when(...) as a decorator or pass a flow name as the

first positional TriggerFlow(...) argument.

Anti-Patterns

joins, and execution-managed work.

resources and resolvers.

runtime metadata.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.