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.

Tip: New to this? The Agent Quickstart has setup steps and copy-paste prompts. This page is the full reference. Building by hand instead? See the CLI docs, or the Quickstart for the visual editor.

Overview

There are three entry points an agent can use, in increasing order of integration:

SurfaceUse it for
llms.txtZero-setup discovery — a single text file linking the DSL reference, schema, and validation endpoint.
AGENTS.mdRepo-level instructions when the workflow JSON lives in your codebase.
MCP serverFull 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.

Tip: The canonical agent-readable version of these practices is published at $APP_URL/llms/dsl-authoring.md and is also available from get_dsl_reference with section authoring.
bash
edit local JSON → validate → review → deploy → trigger a test run
                                              ↓
                         inspect the immutable deployment snapshot
PracticeAgent instruction
Local source of truthEdit and deploy the repository JSON. If someone changed the dashboard draft, pull it into Git before making another change.
Validate firstLoad the relevant DSL references, validate the exact local definition, fix every error, then create or update and deploy.
Keep environments out of DSLUse logical connection slugs in JSON. Supply connection bindings at deploy time; never commit tokens, keys, OAuth data, or environment-specific connection IDs.
Orient participantsBefore 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 ownershipUse 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 safelyKeep deployments private by default. Public access is only for benign, single-human-participant workflows without privileged effects.
Verify runtime truthAfter 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.
Warning: An in-workflow host API call is appropriate when its answer must change the remaining participant interaction, such as detecting a duplicate before asking for confirmation. It is not final acceptance. The host must validate again before committing any business action.

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.

Warning: For speech assessment, Gemini observations are qualitative and uncalibrated. Do not generate standardized pronunciation or acoustic scores. Keep provider/model/confidence provenance beside the output, and validate the workflow to detect rollout or surface constraints.

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}}.

Warning: Durable branches currently allow synchronous work, Delay, Agent checkpoints, awaited child workflows, Input, Editor, forms, turn-based converse, and nested Parallel. Participant prompts are delivered serially per role. Live converse remains invalid in a branch.

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.

bash
$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
Tip: Point your agent at $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:

markdown
# 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.

json
{
  "mcpServers": {
    "chatterfly": {
      "type": "http",
      "url": "https://api.chatterfly.in/mcp",
      "headers": {
        "Authorization": "Bearer ${CHATTERFLY_TOKEN}"
      }
    }
  }
}

Available tools:

ToolDescription
validate_workflowValidate a DSL definition and return stable surface/provider/model/rollout diagnostics.
get_workflow_ephemeral_eligibilityCheck a target workflow's nested eligibility before choosing inline ephemeral bulk execution.
create_workflowCreate a workflow.
update_workflowUpdate a workflow.
deploy_workflowDeploy a workflow.
list_workflow_deploymentsList immutable deployment history without returning each definition.
get_workflow_deploymentFetch one immutable deployed DSL snapshot, including a revoked snapshot.
create_workflow_keyMint a stable server-side workflow key.
trigger_workflowTrigger a test run.
get_runFetch a run by ID, including aggregate durable fan-out summaries when present.
get_run_fanoutsList durable Parallel and WorkflowCall.for_each fan-out summaries for a run.
get_run_fanout_itemsPage ordered fan-out items, optionally filtering active, completed, failed, or cancelled items before cursor pagination.
retry_run_fanout_itemRetry a failed or cancelled branch item after confirm=true.
cancel_run_fanout_itemCancel an unstarted branch item after confirm=true.
retry_run_fanout_itemsAtomically retry 1-100 failed or cancelled items after confirm=true.
cancel_run_fanout_itemsAtomically cancel 1-100 unstarted items after confirm=true.
list_connectionsList configured connections.
list_toolsList tools available to Agent nodes.
list_agentsList reusable registered agents with model, tool, and harness configuration.
list_modelsList model structured-output, reasoning, caching, and vision capability flags for Agent authoring.
list_surfacesList surface traits, node permissions, Live-converse rollout state, and style/provider/model ownership constraints.
list_knowledge_basesList knowledge bases for Agent 'knowledge' bindings.
get_dsl_referenceLoad a DSL reference section, including parallel for durable Parallel and WorkflowCall.for_each fan-out.
get_embed_referenceLoad 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.

Warning: Management MCP tools never accept OAuth tokens, client secrets, or arbitrary runtime operation calls. They may report connection and app readiness, but OAuth app secrets must be entered interactively by a workspace owner/admin. Preserve verified actor, organization, account, region, and scope metadata, and keep user-attributed mutations private.

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.

bash
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.

Tip: Live-converse compatibility uses stable codes including 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.