Skip to content

AI Flow Drafting

Audience: Everyone · Tags: ai, snap-studio, flow, draft

Purpose. Describe what you want in plain English and let SnapLink draft the flow for you, instead of writing the trigger/action JSON by hand.

SnapLink's assistant drafts flows for you. It never turns anything on, never runs anything, and never sees your credentials. You review and approve every flow before it exists.

That sentence is the whole doctrine, and it applies identically to both drafting paths described below — there is no version of AI drafting in SnapLink that skips your review.

Two drafting paths — which one to use

Snap Studio (recommended) Raw /flow-designer/draft endpoint
What it is A guided, 3-stage builder: Describe → Review & edit → Save & test A single lower-level API call
Output An editable plan (plain-English steps + form fields) you review before anything is compiled into a flow A raw FlowDefinition + a rationale, immediately
Drafting engine "llm" (a real model drafted it) when configured, or "rules" (deterministic keyword matching) as the guaranteed fallback Always "rules" — deterministic keyword→template matching only
Can build Webhook trigger + email or generic REST actions Webhook trigger + whichever of the 7 templates best matches your prompt (so it can produce Slack/Teams/HubSpot steps too, via a template match)
Test run built in Yes — approve, then test-run, then read a plain-English explanation of what happened No — you'd build/promote/run separately
Activates anything Never Never (activated: false, always)

Use Snap Studio unless you're integrating SnapLink programmatically and want the raw primitive. Full walkthrough: Snap Studio → Describe It and Snap Studio overview.

Snap Studio, in brief

  1. Describe — type what you want, e.g. "When my link is called, email ada@example.com to say a new lead came in."
  2. SnapLink drafts a plan: a name, a plain-English summary, and one step per trigger/action with editable fields (POST /flow-designer/studio/plan).
  3. Review & edit — change any field. Run POST /flow-designer/studio/check as often as you like; it re-validates the plan and reports plain-language problems tied to the exact step/field to fix.
  4. Save & test — POST /flow-designer/studio/approve creates the flow, drafts, and promotes it in one step (only once check reports ok: true). Then POST /flow-designer/studio/test-run runs it for real and returns a friendly explanation (headline, per-step steps, and a problem if it failed) — the same thing you'd get from GET /flow-designer/studio/runs/:runId/explain afterward.
curl -X POST https://api.snaplink.cloudsolutionaccelerators.com/api/v1/flow-designer/studio/plan \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"prompt": "When my link is called, email ada@example.com to say a new lead came in."}'
{ "data": { "plan": {
  "engine": "rules",
  "name": "When my link is called, email ada@example.com...",
  "summary": "Here is the plan: whenever your SnapLink link is triggered, I will send an email to ada@example.com. Look over each step below — you can change anything — then check and save it.",
  "steps": [
    { "id": "trigger", "kind": "trigger", "title": "When: your SnapLink link is triggered", "connectorKey": "webhook", "capability": "webhook", "fields": [] },
    { "id": "action-1", "kind": "action", "title": "Then: send an email", "connectorKey": "email", "capability": "send_email",
      "fields": [
        { "key": "to", "label": "Send it to (email address)", "value": "ada@example.com", "required": true, "type": "email" },
        { "key": "subject", "label": "Email subject", "value": "A message from your SnapLink flow", "required": false, "type": "text" },
        { "key": "text", "label": "The message to send", "value": "Hello! Your SnapLink flow just ran.", "required": true, "type": "textarea" }
      ] }
  ],
  "questions": []
} } }

engine: "rules" means the deterministic fallback drafted this (no AI key configured, or the model call didn't produce a usable plan); engine: "llm" means a real model drafted it. Either way, the plan is just a starting point sitting in front of you, unsaved, waiting for your edits and approval.

The raw /flow-designer/draft endpoint

This is the older, lower-level primitive — useful if you're scripting flow creation and don't need the guided review UI. It is always rule-based (no LLM option) and works by keyword-matching your prompt against the 7 flow templates:

curl -X POST https://api.snaplink.cloudsolutionaccelerators.com/api/v1/flow-designer/draft \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"prompt": "When a new HubSpot lead arrives notify sales in Slack"}'
{ "data": {
  "draftFlow": { "trigger": { "...": "..." }, "actions": [ { "...": "..." } ] },
  "rationale": "Matched the \"HubSpot Lead → Slack Alert\" template from the prompt (connectors: hubspot, slack). Review before activating.",
  "matchedTemplateId": "hubspot-lead-to-slack",
  "explanation": { "summary": "...", "executionPath": [ "..." ], "connectorsUsed": [ "hubspot", "slack" ], "requiredCredentials": [ "..." ], "potentialFailurePoints": [ "..." ] },
  "activated": false
} }

activated is always false — this endpoint returns a draft FlowDefinition for you to inspect, then build for real via Creating Flows. It never creates or saves anything on its own.

What the assistant cannot do

Whichever path you use, be aware of one real limitation: message text is fixed, not templated. Whatever you type (or the assistant fills in) for a Slack message, an email body, or a REST payload is sent exactly as written, every time the flow runs. Neither drafting path can pull fields out of the incoming webhook payload and insert them into the outgoing message — there is no mapping/templating engine yet. If you need the message to vary per event, that's a gap to plan around, not something to describe your way past.

Best practices

  • Name the apps involved in your prompt ("Slack", "HubSpot") — it's how both engines detect intent.
  • Always read the plan/draft before saving — it's designed to be reviewed, not rubber-stamped.
  • For Slack/Teams/HubSpot flows, use the raw /flow-designer/draft endpoint or a template directly — Snap Studio's guided builder is currently scoped to email and generic REST actions.

FAQ

Is this a general-purpose chatbot? No — it's a focused drafting assistant that turns intent into a reviewable flow, nothing more. Does it ever see my connector credentials? No, never — by design, in both paths. Will Snap Studio support more connectors over time? That's the direction, but today it's webhook + email/REST only; see Snap Studio for the current scope.

If something goes wrong

If a plan won't check out, or a test run fails, see Studio problems.


Related: Snap Studio → Describe It · Flow Templates · Flow Validation · Flow Debugging