For coding agents
Chatterfly is built so coding agents can author workflows reliably. Workflows are a JSON DSL with a published schema, a validation endpoint with no side effects, and machine-readable reference docs an agent can load on demand.
Overview
There are three entry points an agent can use, in increasing order of integration:
| Surface | Use it for |
|---|---|
| llms.txt | Zero-setup discovery — a single text file linking the DSL reference, schema, and validation endpoint. |
| AGENTS.md | Repo-level instructions when the workflow JSON lives in your codebase. |
| MCP server | Full tool access — validate, create, update, deploy, and trigger workflows from inside the agent. |
Authoring best practices
When a workflow is developed as code, keep its editable JSON in the application repository. Git is the authoring history, the Chatterfly draft is the latest mutable platform copy, and each deployment is an immutable record of what ran. A dashboard save is not a replacement for source control: undeployed draft history cannot be recovered.
$APP_URL/llms/dsl-authoring.md and is also available from get_dsl_reference with section authoring.edit local JSON → validate → review → deploy → trigger a test run
↓
inspect the immutable deployment snapshot| Practice | Agent instruction |
|---|---|
| Local source of truth | Edit and deploy the repository JSON. If someone changed the dashboard draft, pull it into Git before making another change. |
| Validate first | Load the relevant DSL references, validate the exact local definition, fix every error, then create or update and deploy. |
| Keep environments out of DSL | Use logical connection slugs in JSON. Supply connection bindings at deploy time; never commit tokens, keys, OAuth data, or environment-specific connection IDs. |
| Orient participants | Before a new interaction task, add a participant-facing Message when the next prompt lacks context. Explain what a Repeater, form, upload, review, role handoff, or converse Agent will collect without naming engine internals or repeating a clear Input prompt. |
| Split validation ownership | Use Input validation to re-prompt people and Agent output validation to repair model output. Treat completed workflow state as untrusted input; the host application revalidates domain rules, authorization, persistence, and side effects. |
| Deploy safely | Keep deployments private by default. Public access is only for benign, single-human-participant workflows without privileged effects. |
| Verify runtime truth | After deployment, inspect the deployment snapshot rather than assuming the mutable draft is live. Use a workflow ID for latest-live embeds, a stable cfw_ key for server integrations, and pin deployment IDs only for canary or rollback. |
Live converse authoring
Coding agents should always author adaptive conversations as Agent[mode="converse"]. Runtime selection is derived from the effective participant surface after inheritance resolves. A Live-capable Gemini voice surface uses one persistent audio session; other surfaces use the existing turn-based collector. There is no live_converse mode.
Parallel authoring
Use Parallel only for a small, static set of independent branches. Branches read frozen parent state, write under their branch ID, and cannot reference sibling-local output while they run. Read output after the join as {{parallel_id.branch_id.step_id}}.
Load the Parallel execution guide before authoring joins, failure policy, or recovery operations.
llms.txt & DSL reference
Every Chatterfly deployment serves an llms.txt discovery file plus the full DSL reference as plain Markdown. All URLs are derived from your app origin.
$APP_URL/llms.txt # discovery entry point
$APP_URL/llms/dsl-authoring.md # workflow-as-code best practices
$APP_URL/llms/dsl-core.md # execution model, state, IDs
$APP_URL/llms/dsl-nodes.md # node table + field specs
$APP_URL/llms/dsl-conditions.md # condition expression syntax
$APP_URL/llms/dsl-input-fields.md # input_type variants
$APP_URL/llms/dsl-hitl.md # human-in-the-loop model
$APP_URL/schemas/workflow.json # JSON schema
$APP_URL/openapi.yaml # management API spec$APP_URL/llms.txt first — it links everything else.AGENTS.md
When workflow definitions live in your repository, drop an AGENTS.md at the root so agents pick up the operational rules automatically. Adapt this starter to your workflow paths and deployment policy:
# Chatterfly workflow authoring
- Workflow JSON under `workflows/` is the authoring source of truth. Edit the local file; do not treat the Chatterfly draft as version history.
- Before authoring, load the Chatterfly DSL references needed for the nodes, conditions, inputs, HITL, surfaces, or providers involved.
- Never author `dsl_version`. Use PascalCase node types and sibling-unique node IDs.
- Use stable logical connection slugs. Never put tokens, keys, OAuth data, deployment bindings, or environment-specific connection IDs in workflow JSON.
- Default to the `widget` surface. Discover surface capabilities before using voice, messaging, forms, uploads, or other gated nodes.
- Author multi-turn collection as `Agent[mode="converse"]`. Never invent a `live_converse` mode; the resolved participant surface selects the runtime.
- Orient people before a new interaction task. Add a participant-facing `Message` before a Repeater, form, upload, review, handoff, or converse Agent when the next prompt alone lacks context. Do not narrate node types or duplicate a clear prompt.
- Use `Input.validation` for immediate participant correction and Agent `output_schema` / `output_validation` for model repair. The host application must revalidate completed output before persistence or side effects.
- For mutations: collect, validate, show a review, obtain explicit confirmation, then call the mutating Tool. Keep privileged and multi-participant workflows private.
- Validate the exact local definition and fix every error before create, update, or deploy. Trigger a test run after deployment.
- Inspect immutable deployment snapshots to verify what is or was live. Do not infer runtime state from the mutable draft.
- Use workflow IDs for latest-live embeds, stable `cfw_` keys for server integrations, and deployment IDs only for deliberate pinning, canary, or rollback.MCP server
The backend can expose a Model Context Protocol server over streamable HTTP at /mcp.
The tools are thin clients over the management API. Authenticate with a personal access token (cfpat_…) — create one in the dashboard under Settings → API tokens. The token is bound to one workspace, so no X-Tenant-IDheader is needed. Chatterfly Cloud's MCP endpoint is https://api.chatterfly.in/mcp.
Claude Code requires type: "http" for remote servers; the example below is valid in its project-scoped .mcp.json configuration.
{
"mcpServers": {
"chatterfly": {
"type": "http",
"url": "https://api.chatterfly.in/mcp",
"headers": {
"Authorization": "Bearer ${CHATTERFLY_TOKEN}"
}
}
}
}Available tools:
| Tool | Description |
|---|---|
| validate_workflow | Validate a DSL definition and return stable surface/provider/model/rollout diagnostics. |
| get_workflow_ephemeral_eligibility | Check a target workflow's nested eligibility before choosing inline ephemeral bulk execution. |
| create_workflow | Create a workflow. |
| update_workflow | Update a workflow. |
| deploy_workflow | Deploy a workflow. |
| list_workflow_deployments | List immutable deployment history without returning each definition. |
| get_workflow_deployment | Fetch one immutable deployed DSL snapshot, including a revoked snapshot. |
| create_workflow_key | Mint a stable server-side workflow key. |
| trigger_workflow | Trigger a test run. |
| get_run | Fetch a run by ID, including aggregate durable fan-out summaries when present. |
| get_run_fanouts | List durable Parallel and WorkflowCall.for_each fan-out summaries for a run. |
| get_run_fanout_items | Page ordered fan-out items, optionally filtering active, completed, failed, or cancelled items before cursor pagination. |
| retry_run_fanout_item | Retry a failed or cancelled branch item after confirm=true. |
| cancel_run_fanout_item | Cancel an unstarted branch item after confirm=true. |
| retry_run_fanout_items | Atomically retry 1-100 failed or cancelled items after confirm=true. |
| cancel_run_fanout_items | Atomically cancel 1-100 unstarted items after confirm=true. |
| list_connections | List configured connections. |
| list_tools | List tools available to Agent nodes. |
| list_agents | List reusable registered agents with model, tool, and harness configuration. |
| list_models | List model structured-output, reasoning, caching, and vision capability flags for Agent authoring. |
| list_surfaces | List surface traits, node permissions, Live-converse rollout state, and style/provider/model ownership constraints. |
| list_knowledge_bases | List knowledge bases for Agent 'knowledge' bindings. |
| get_dsl_reference | Load a DSL reference section, including parallel for durable Parallel and WorkflowCall.for_each fan-out. |
| get_embed_reference | Load the widget embedding guide. |
Native providers
Discover provider products and capabilities before authoring tools; never guess operation names, scopes, or provider hosts. For Zoho, uselist_connection_operations andget_connection_metadata, bind logical slugs at deploy time, and load get_dsl_referencewith section zoho for the maintained LLM reference.
Validation endpoint
The validation endpoint has no side effects — agents can call it as often as needed while iterating. It runs the same engine validators as the save path plus a DSL-version gate.
curl -X POST "$CHATTERFLY_API_URL/api/management/workflows/validate" \
-H "Authorization: Bearer $CHATTERFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "definition": { /* workflow JSON */ } }'The response shape is { valid, dsl_version, errors[], warnings[] }, where each issue carries { path, code, message, severity }. When present, path is the offending workflow node ID and can be used to focus the editor or repair the definition.
Before selecting inline ephemeral bulk execution, inspect a target workflow with GET /api/management/workflows/{id}/ephemeral-eligibility. It returns every nested node that can suspend, create durable work, or communicate with a participant. The runtime repeats that check against the pinned deployment before execution.
converse.live_rollout_disabled, converse.live_provider_unsupported, and converse.live_model_unsupported. The MCP tool, CLI, editor, and REST endpoint all consume this same response. Widget voice is enabled; the rollout code applies to surfaces that remain gated, such as phone.