This is the canonical workflow manual. The API is experimental. Read the execution contracts for current persistence, visibility, and compatibility guarantees.
Purpose and scope
An EDSL workflow coordinates work performed by people, language-model agents, or a mixture of both. It decides who receives each task, when a task becomes available, which earlier answers it may observe, how results are combined, and what happens after failures or restarts. The workflow layer is deliberately separate from delivery. Humanize can create private surveys, send invitations, and collect responses. A simulated inbox can deliver the same work to EDSL agents. The workflow coordinator remains the authority that decides what becomes ready next. This manual describes the implementation inedsl.workflows. It covers:
- dependency graphs and work-item lifecycles;
- participant selection, fan-out, and fan-in;
- typed answer, output, and submission references;
- serializable conditions and deterministic derived values;
- bounded repeat blocks;
- visibility and anonymity boundaries;
- shared-state reads and writes;
- human delivery and LLM simulation;
- durable retries, leases, and process recovery;
- SQLite persistence and DAG visualization; and
- reusable design patterns and current limitations.
CLI commands
Theep workflow namespace manages research-task gates. The respondent
orchestration API described here has its own ep orchestration namespace. It
accepts a portable WorkflowExperiment JSON file. Create the bundle in Python
and save it with experiment.save("experiment.json"):
validate checks the workflow, participants, state maps, and executor bindings.
inspect reports participants, steps, question names, dependencies, assignments,
state-map IDs, and executor routing. Both commands return the standard JSON
envelope and make no model calls.
run requires an output directory. It writes the pinned experiment.json,
workflow.sqlite, one SQLite file per state map, and completion.json when the
run reaches a declared pause or completion. Start with a new output directory.
For recovery, use the same experiment, output directory, and --instance-id
with --resume; the default instance ID is experiment. The pinned definition
must match the original run. Repeat --responses when resuming a replay-driven
run. Omitting it on resume switches back to the configured executors and can
make provider calls or leave human work without an answer source.
Without --responses, configured LLM executors may call model providers. To
replay answers without model calls, pass a JSON array like this (or wrap it in
{"responses": [...]}):
--instance-id selects the durable workflow instance, and --resume recovers
an existing one. ep orchestration run --help lists every option.
For real human participants, use start and sync. This mode currently
requires every participant to resolve to the human executor and to have a
non-empty email trait. start initializes a fresh run but sends no invites;
sync dispatches ready Humanize surveys, imports completed responses, then
dispatches any newly unlocked work:
sync again to collect later responses and send newly ready tasks. Configure
Expected Parrot authentication before syncing. status reports item IDs,
participants, step names, item states, and the event count. start requires a
new or empty output directory and records a pinned experiment plus run manifest.
The central idea
A workflow turns a declarative graph into durable, respondent-specific work: The key invariant is:Delivery systems do not decide workflow order. They deliver ready work and return answers. Only the coordinator evaluates dependencies and conditions.This separation allows the same definition to run with real respondents during fieldwork and with LLM respondents during design, testing, and stress analysis.
Who performs the work?
The workflow definition says who is eligible for a step by selecting a participant role. It does not currently say whether that participant is a person or an LLM. That choice belongs to execution:
This neutrality is useful: one serialized protocol can be rehearsed with LLMs
and later deployed unchanged to people. It also means that diagrams in this
manual mark the execution path, not a property embedded in
HumanStep.
Diagrams label human and simulated respondents explicitly.
Performer routing is declared separately from the scientific workflow:
to_dict() and from_dict(), requires exactly one
matching binding per participant, and lets WorkflowSimulation select distinct
answerers by executor kind. Production still needs an adapter registry that
dispatches the human bindings to Humanize and persists the resolved executor on
each attempt. Step metadata may describe the intended performer for diagrams,
but it is not the routing authority.
Waiting for optional work
Normalafter= dependencies propagate a predecessor’s skip. Use
after_settled= when a downstream step must wait for optional work but should
still run if that work is skipped:
committing. A successful quorum
supersedes outstanding unaccepted assignments; it is not a branch skip. Only
after= propagates a genuine predecessor skip to the consumer.
A first workflow
Suppose one person proposes a weekend activity and a second person approves it.propose. The question also
contains a typed reference to the proposal answer.
Participants are ordinary EDSL agents whose traits determine their roles:
Launch and complete work
Use a SQLite store for durable local execution. A stable scientific seed makes workflow chance expressions reproducible independently of the generated instance ID.launch() creates a new instance. The response keys include the work
item ID, so rerunning the walkthrough in the same database is safe. To continue
an existing instance after a restart, save its instance_id, reopen the same
store, and restore and recover
instead of calling launch() again.
Manual chapters
- Lifecycle, assignment, and dependencies — Understand definitions, instances, work items, participant selection, fan-out, and fan-in.
- References, conditions, and quorum — Pass answers between steps, compose conditions, and set completion policies.
- Derived values and economic settlement — Compute deterministic aggregates, allocations, and payoffs within a serialized workflow.
- Response contracts and repetition — Validate structured answers and build bounded revision or repeated-game loops.
- Visibility and shared state — Control respondent observations and integrate explicit shared-state reads and effects.
- Persistence, delivery, and simulation — Persist work in SQLite and deliver it through the outbox, Humanize, or simulated respondents.
- Recovery and portability — Recover durable attempts, manage leases and retries, and serialize workflow definitions.
- Workflow patterns and testing — Inspect audit evidence and develop protocols using reusable patterns and deterministic tests.
- API reference and limitations — Review the compact API, implementation boundaries, and responsibility model.
