Author workflows with an agent
1. Inspect and register contracts
Section titled “1. Inspect and register contracts”Ask the agent to call inspect_contract for the exact chain and address. Review deployed code, saved state, proxy/implementation candidates, and ABI digest. If needed, confirm register_contract with a supplied ABI or explicit Sourcify candidate.
Registration never overwrites a conflicting ABI. Resolve conflicts in the web app after independent verification.
2. Build a strict definition
Section titled “2. Build a strict definition”Give the agent the operational goal, allowed execution accounts, required variables, and review constraints. A V2 definition can include:
- step, condition, and manual nodes;
- explicit ref-based edges;
- step outputs;
- structured literal/variable values;
txcast-cel-v1expressions;- canonical ABI functions; and
- static raw calldata with a reason.
Ask for validation before storage. The account grant applies during validation and authoring.
3. Create or replace
Section titled “3. Create or replace”create_workflow atomically creates the parent and populated strict draft. The result maps the agent’s readable node refs to stored UUIDs.
replace_workflow_draft replaces the entire strict definition and requires current revision, draft version, and definition digest. It cannot overwrite an incomplete human draft.
4. Publish
Section titled “4. Publish”Publish the workflow revision as a separate confirmed action using the current concurrency fields. Refresh after a 409 and compare the latest definition before retrying.
No agent operation implicitly fetches an ABI while authoring.