Automations
A workflow is a trigger and the nodes after it, joined by connections. Each time its trigger fires it starts a run, which goes node by node, waits where it’s told to, and keeps what every node got and gave. Everything here needs the automations permissions: automations:read to read, automations:write to change.
Workflows, versions and runs
Section titled “Workflows, versions and runs”Saving isn’t publishing. PUT /api/v1/automations/workflows/{id} keeps the nodes and connections as the workflow’s changes (hasChanges is true), which no run uses. POST /api/v1/automations/workflows/{id}/publish makes them what runs, as the next version, after the same checks the editor marks (POST /api/v1/automations/workflows/check). Turning a workflow on with POST /api/v1/automations/workflows/{id}/status publishes its changes first, if it has any or was never published. A workflow made with POST /api/v1/automations/workflows is a draft whose graph becomes version 1 when it’s turned on.
Runs keep their version. A run copies the version it starts from, so publishing changes nothing about runs already going, even ones in the middle of a long wait. Each run says its version (null for a test from the editor). Retrying a failed run carries on from the node that failed with the workflow as it’s published now. POST /api/v1/automations/workflows/{workflowId}/versions/{version}/restore puts an earlier version back as the workflow’s changes, to look over and publish; it runs nothing differently until then.
What starts a workflow
Section titled “What starts a workflow”Most triggers start on an event a module emits in the same transaction as the change, so a run commits with what caused it or not at all. Each run’s first item has the record and its contact, in the shape the editor’s samples show.
| Trigger | Event | Settings |
|---|---|---|
| Contact added, Contact changed | contact.created, contact.updated |
where they came from; which fields changed |
| Tag added, Tag removed | contact.tag_added, contact.tag_removed |
the tag, or any |
| Task due | task.due |
whose tasks |
| Opportunity moved, won, lost | opportunity.stage_changed, opportunity.won, opportunity.lost |
the pipeline, and the stage it moved into |
| Booking created, cancelled, moved, no-show | booking.created, booking.cancelled, booking.rescheduled, booking.no_show |
the calendar |
| Invoice paid, overdue; quote accepted; document signed; subscription cancelled | invoice.paid, invoice.overdue, quote.accepted, document.signed, subscription.cancelled |
an invoice’s least amount |
| Order paid, refunded, shipped; checkout expired | order.paid, order.refunded, order.fulfilled, checkout.expired |
least amount; partial refunds; whole orders only |
| Message received, Call missed, Chat started | message.received, call.missed, chat.started |
the channel: SMS, email, WhatsApp, Messenger, Instagram or live chat |
| Review received | review.received |
the source, and a range of ratings |
| Form submitted, Page visited | form.submitted, page.visited |
the form; the pages |
| Newsletters and email | newsletter.subscribed, newsletter.unsubscribed, email.opened, newsletter.clicked |
where from, which emails |
| Subscription confirmed, Post published, Referral milestone reached, Poll answered, Upgraded to a paid tier, Downgraded or cancelled | newsletter.confirmed, newsletter.published, newsletter.referral_milestone, newsletter.poll_answered, newsletter.upgraded, newsletter.downgraded |
posts for whom; least referrals; the question’s words and the answer |
| Book published, Book print order updated | book.published, book.print_order.updated |
the store; the print order’s status |
| QR code scanned | qr.scanned |
the workflow that made the codes, or any; each code’s first scan only, or every scan |
| Personalised video watched, Video page button clicked | video.watched, video.cta_clicked |
the video template, or any; how far (a quarter, half, three quarters or to the end), once per page |
| Date reached | a daily timer | a date field, every year or once, on the day or days either side, and a time |
| Schedule, Webhook | a timer; a request | when; the path, method and signature check |
Date reached watches when contacts were added, or any custom field of the date type (add a Birthday field in CRM › Custom fields). One timer for the workspace wakes at the soonest time a date workflow is due and starts a run for each contact whose day it is, up to 1,000 a workflow a day; it’s there only while such a workflow is on. A date every year comes round on its day and month in later years (29 February on the 28th in other years).
Page visited starts for a contact you know, opening a page on one of your sites. A form sent or a checkout paid from a browser links that browser’s persistent visitor id (Analytics) to the contact. While a workflow on wants page visits, Dispatch sends a known visitor’s pages to Digize; anyone else’s pages send nothing. The same page from the same visitor within 30 minutes counts once. A path ending in * takes every page under it.
Who it takes and what ends it
Section titled “Who it takes and what ends it”PUT /api/v1/automations/workflows/{id}/rules sets two things, which apply at once, without publishing:
- Enrolment:
always(each time the trigger fires),once(once per contact, ever, even after their runs are pruned) oragainafterdayssince their last run started. Runs without a contact, such as from a schedule or a webhook, always start. - Exit conditions: up to 10 events about the contact (
order.paid,booking.created,contact.tag_addedwith a tag,message.received,newsletter.unsubscribedand the rest inCONTACT_EVENTS). When one happens, the contact’s runs of the workflow end where they are, with the statusexitedand the condition inerror. Exits are worked out before the event starts any new runs, so an order can end the last win-back run and start the next.
A run’s own steps never start its own workflow again, so a workflow can’t loop on itself through the events it causes.
Flow nodes
Section titled “Flow nodes”- Goal: names an event about the contact (and a tag, for tag events). When it happens, their run jumps to the goal from wherever it is, skipping the steps between, even in the middle of a wait. Someone who already has a goal’s tag meets it. A run that reaches the goal in its turn without meeting it carries on, or ends there if the goal says to.
- A/B split: 2 to 5 paths, each with a share of the runs. A run with a contact takes one path at random by those shares, and the contact keeps it whenever they come back (while it still has a share); a run without a contact picks for each item, the same one again on a retry. The runs list and each run’s step say which path it took. The split’s goal (
goal, an event about the contact;goalTagfor a tag event;goalDays, 1 to 90, 7 by default) says what counts as a win: see A/B tests. - Go to: sends the run back, or on, to another step, at most 1 to 20 times in a run; after the last time it carries on from its own output. Runs stop after 250 steps in all.
- Wait for a time window: waits until it’s inside the days and hours chosen, on the clock schedules use (an overnight window such as 22:00 to 06:00 runs past midnight), and goes straight on inside it.
A/B tests
Section titled “A/B tests”Each A/B split is a test. The first time a contact reaches a split they’re counted on the path they take, once, however often they come back. What they do in the next goalDays days counts for that path: the split’s goal happening is a win, and the orders and invoices they pay add to its revenue (in the workspace’s currency; money in another currency isn’t added). Runs without a contact, and tests from the editor, aren’t counted. The counts are kept apart from runs, so they last as long as the test, whatever Settings keeps runs for.
GET /api/v1/automations/workflows/{workflowId}/split-tests gives each split in the workflow (those in the published version, then those only in its changes, with published false) and, for each path, its contacts, wins, win rate, lift over the first path that has contacts with a 95% interval, chanceToBeBest, revenue and revenuePerContact. The chances come from a Beta-Binomial model drawn from the counts, the same way every time for the same counts. Its verdict is too_early until the test has run 7 days with 50 contacts on each path that has a share, then winner once a path is 95% likely to be best, no_difference once every path has the contacts to show a 20% lift and none did, or keep_going. Without a goal it’s no_goal, and only revenue compares.
PUT /api/v1/automations/workflows/{workflowId}/split-tests/{nodeId}/winner picks a path: from then on every run that gets to the split goes down it, runs already going included, and new contacts stop being counted (verdict is decided). A null winner puts it back to testing by its shares. The split has to be in the published version. DELETE /api/v1/automations/workflows/{workflowId}/split-tests/{nodeId}/results forgets everyone the split counted, to count afresh after its paths or goal change; contacts who come back take a path anew.
Actions
Section titled “Actions”A node’s words can hold expressions that read the run’s items: {{ $json.contact.firstName }} reads the item the node is working on, {{ $('Form submitted').item.json.email }} another node’s, and {{ $now }} the time. After ||, a quoted text is written when the value is empty: {{ $json.contact.firstName || "there" }}.
Besides texts, emails, the CRM and other apps, workflows can remove tags, move and update opportunities, create tasks, add contacts to and take them off static lists, subscribe and unsubscribe them from newsletters (someone who unsubscribed stays unsubscribed), notify members in the bell and by email, and ask for a review with Reviews’ tracked link and rating gate.
Send newsletter email emails the run’s contact an email written in the post editor’s blocks (email: subject, preview and blocks), through the workspace’s newsletter service (Resend, SendGrid or Mailjet) from its newsletter address, with the footer, their unsubscribe link and, with open tracking on, the open pixel. Only subscribers get it: anyone else is passed by with skipped: true and why, and the run goes on. Its merge tags are the newsletter’s, filled for each subscriber; expressions don’t apply inside email (Newsletter automations).
Change tier (newsletter.change_tier) gives the run’s contact a comp of a paid newsletter tier (mode: "give", tier, and length: "days" with days, 1 to 3,650, or length: "date" with until, a YYYY-MM-DD date that lasts through that day on the workspace’s clock, or a date and time), or ends their comps (mode: "end", at any tier or the tier given). It’s the comp members give by hand, so it emits newsletter.upgraded and newsletter.downgraded when it moves them, and it never calls Stripe: a paid subscription is never cancelled by an automation. A longer comp at the tier is kept and a shorter one replaced. Only subscribers get a tier (anyone else is passed by with skipped: true and why); an archived or deleted tier fails the step, and a workflow that gives one can’t be turned on. It answers change, tierId, tier, until, given or ended, and readerTier (Newsletter automations). Tiers’ ids are in GET /api/v1/newsletter/tiers.
WhatsApp and Messenger send through Conversations’ channels (Channels). WhatsApp goes from the workspace’s Twilio WhatsApp sender, starting a conversation if there’s none; outside 24 hours after the contact’s last message, WhatsApp only takes approved templates. Messenger answers in the conversation the contact started with your Page, since a Page can’t write first. Either is refused, and the editor won’t turn the workflow on, until the channel is connected.
Send a postcard or letter (mail.send) has Click2Mail print and mail a piece through the workspace’s own Click2Mail account, in one of the designs Click2Mail’s Send mail tab has: piece (postcard_4x6, postcard_5x8, postcard_6x11 or letter, with color for a letter), mailClass (first_class, or marketing, which USPS takes only 200 pieces or more at a time, so a step with fewer goes First-Class), template (classic, bold or fresh) and the words, which can be expressions: headline (60 characters at most once filled in), body (240), offer (44), code (16, upper-cased) and link (60, printed on the piece and where its QR code goes). It goes to the contact’s mailing address in the CRM (to: "contact", contact by id: their Street address, City, State and ZIP code fields, which a LeadsPlease list’s import adds), or to an address filled in (to: "address": recipient or company, street, city, state as two letters and zip). Items that come out the same go as one mailing, named name or after the workflow, sent at once for the next day USPS collects; it shows on the Mailings tab with the workflow, is charged to the Click2Mail account, counts on direct mail’s monthly limit and is followed to the mailbox as any mailing is (GET /api/v1/mail/mailings/{id}, whose workflowId names the workflow), and each contact’s timeline says what was mailed. The step answers mailingId, name, status, piece, mailClass, color, mailDay, pieces (in its mailing), cost (the mailing’s, in cents, an estimate until Click2Mail prices it), contactId and to. A contact without a whole address, a state or ZIP code that isn’t one, or words that come out too long fail the step, and nothing is mailed. It needs Click2Mail connected with a return address: until then the editor won’t turn the workflow on.
Send a PCM postcard or letter (mail.pcm) has PCM Integrations (PostcardMania) print one of the workspace’s own PCM designs and mail it through its PCM account: piece (postcard or letter, with color and bothSides for a letter, which goes in a full-window envelope with the address on a page of its own), design (the design’s PCM id, from GET /api/v1/pcm/designs, of that piece) and mailClass (first_class, or standard, which USPS takes only 200 pieces or more at a time, so a step with fewer goes First-Class). It goes to the contact’s mailing address in the CRM or to an address filled in, with the same to, contact, recipient, company, street, city, state and zip as Send a postcard or letter, from direct mail’s return address. A step’s items that come out the same go as one PCM order, placed at once and charged to the PCM account; GET /api/v1/pcm/orders shows it, POST /api/v1/pcm/orders/{id}/cancel cancels it until 11:30 PM Eastern that day, and each contact’s timeline says what was sent (not for a sandbox connection, whose orders are never printed). A step tried again after PCM took its order finds it by its reference rather than ordering again. PCM prints the design as it is, so what changes from piece to piece goes to PCM as the recipient’s design fields: fields, pairs of a field’s name as the design gives it (letters, digits and underscores) and its value, which can be an expression (up to 20, 500 characters each once filled in), such as first_name and {{ $json.contact.firstName }}. With trackedQr, each piece also gets a tracked QR code of its own, as Make a QR code makes: qrLink is where a scan goes on to (UTM tags added unless it has its own), and the code’s scan link goes to PCM as the design field qrField (qr_url unless named), which the design’s QR code must be made from. A scan counts on the code, goes on the contact’s timeline and starts QR code scanned runs, as any tracked code’s does. Codes made for pieces PCM never took are taken away again. The step answers orderId, batchId, reference, piece, designId, design (its name), mailClass, pieces (in its order), sandbox, contactId, qr (the piece’s code: id, code, url, imageUrl, svgUrl, or null) and to. A contact without a whole address, a design PCM no longer has or of another piece, or a state or ZIP code that isn’t one fail the step, and nothing is ordered. It needs PCM Integrations connected with a return address: until then the editor won’t turn the workflow on. Test runs show the order and place none.
With trackedQr (on for new nodes; a node saved before it has it off), each piece’s QR code is a tracked code of its own, as Make a QR code (qr.make) makes: it’s the contact’s, named after the mailing, and goes on to link with utm_source=qr, utm_medium=qr_code and the mailing’s name as utm_campaign. Each scan counts on the mailing as a visit (responses.visits in GET /api/v1/mail/mailings/{id}, which says trackedQr), goes on the contact’s timeline and starts QR code scanned runs and moves goals and exits waiting for “Scans a QR code”; the step answers each piece’s qr (id, code, url, imageUrl, svgUrl), null without it. The link is still printed as written. Since every piece is different, the mailing goes to Click2Mail through its Batch API: one PDF of every piece’s pages and a job per piece, under one batchId (its jobId is null), followed to the mailbox as one mailing. Tracked pieces go First-Class even with mailClass: "marketing", as whether Click2Mail counts a batch’s jobs together for Marketing Mail isn’t known. Cancelling it cancels each piece’s job at Click2Mail; a mailing that’s cancelled or fails before printing takes its codes away.
Make a QR code (qr.make) gives each item a tracked QR code of its own, such as a ticket or a coupon. The code holds a short scan link on the workspace’s link host (its short link domain, or go.<address>.yourfreesite.com): <host>/_q/<code>, 12 lowercase letters and digits. A scan counts on the code and goes on to link (a web address, which can be an expression; https:// is added when it has no scheme), with utm_source=qr, utm_medium=qr_code and utm_campaign as the workflow’s name added unless utm is false or the link has its own. A code is someone’s when contact (by id, {{ $json.contact.id }} by default) names a contact: each scan of theirs goes on their timeline (once a day for a code) and can meet goals and exit conditions waiting for “Scans a QR code” (qr.scanned). name (120 characters at most once filled in) is what the QR codes tab and the timeline call it, the workflow’s name when empty. The picture is drawn at <scan link>.png, size pixels square (128 to 1,024, 512 by default), and <scan link>.svg, in color on background (#rrggbb; the code has to be darker than the background, with a contrast of 3:1 or more, or the editor won’t publish it), with level error correction (L, M, Q or H). Both are public, so emails, texts, Slack posts and printed pieces can show them. The step answers id, code, name, url (the scan link), imageUrl, svgUrl, destination, contactId, size and scans. A link that isn’t a web address, or a contact that isn’t there, fails the step, and nothing is made. A scan starts QR code scanned runs (for one workflow’s codes or any workflow’s, on each code’s first scan only unless set to every scan), whose item has qr (id, code, name, the links, destination, workflowId, workflowName, scans so far, first, scannedAt, device and country) and the code’s contact. Link previews and crawlers aren’t scans, and only the first few scans a minute from one address count. Codes outlast their runs, and a deleted workflow’s codes keep working; DELETE /api/v1/automations/qr-codes/{id} stops one at once. Each workflow that makes codes has a QR codes tab with every code, its scans and when it was last scanned.
Take a screenshot (browser.screenshot) and Browse the web with AI (browser.task) use the workspace’s own Browser Use account, and the editor won’t turn a workflow with either on until it’s connected. Take a screenshot opens each item’s url (a web address, which can be an expression; https:// is added when it has no scheme) in a cloud browser width pixels wide (320 to 1,920) going out through a proxy in country (us by default, none for no proxy), waits wait seconds once it has loaded (0 to 30), and takes what the window shows as a PNG, or with fullPage the whole page as a JPEG, down to about 10,000 pixels. A step takes 10 screenshots at most. It answers id, page, url (a link to the picture that works for a week), type, width, height, title, finalUrl (where the page ended up), country and takenAt. Browse the web with AI gives Browser Use’s agent each item’s instructions (4,000 characters at most once filled in), opening startUrl first if it’s given, and brings back the fields named, pairs of a field’s name (letters, digits and underscores) and what it is, up to 20, for later nodes as fields.<name>. The run waits while the agent works, up to maxMinutes (1 to 30, 10 by default), when it’s stopped and the step fails; maxCostUsd caps what each item’s agent model and searches may spend (0.10 to 25 US dollars, 1 by default), with the browser’s minutes on top. A step runs 5 tasks at most. It answers id, status, result (the agent’s answer in words), fields, minutes, costUsd and steps (how many the agent took). A task the agent couldn’t finish fails the step with why. Each item runs once even when its step is tried again, its browser is stopped when it’s done, and both show in Settings › Integrations › Browser Use › Activity with the run and node that ran them. Test runs show what they would bring back and open no browser.
Make a personalised video (video.make) gives each item’s contact (by id, {{ $json.contact.id }} by default) a page of the template chosen from Outreach › Videos: the template’s video as a bubble over their company’s website or LinkedIn profile card, their name in the title, at <link host>/_w/<code>, with a preview card for LinkedIn, email and Slack. A contact who has a page of the template already gets that one. The run waits while the pages are made (usually under a minute, at most a day), so a message after it never shares a page still being made, then answers id, code, link, thumbnail (the preview card’s address), templateId, templateName, contactId, title, status and background (where it came from). A step makes 100 pages at most, and a workspace 2,000 a day. A template with no video stops the editor turning the workflow on; a contact that isn’t there, or a page that couldn’t be made, fails the step. Test runs show the page they would make and make none.
Visit LinkedIn profile (linkedin.visit), Send a connection request (linkedin.invite), Send a LinkedIn message (linkedin.message) and Withdraw connection request (linkedin.withdraw) go out from a member’s LinkedIn account through the workspace’s Unipile: account is a LinkedIn account’s id (unipile.accounts.list), or campaign in an Outreach campaign’s workflow, where each prospect has an account of their own; contact is the contact by id ({{ $json.contact.id }} by default), who needs a LinkedIn profile URL. Each item’s action is queued on the account’s pacing queue (inside its working hours and daily and weekly limits, a few minutes after the one before) under the key run:<runId>:<step>, so a step tried again queues nothing new, and the step finishes when the action has gone, not when it’s queued: the run waits meanwhile as it does for a Wait, outside its time limit and runs-at-once, so a Wait after it counts from the real send. A visit with notify off reads the profile without showing in their viewers. A request’s note is 300 characters at most once filled; someone connected already is skipped. A message (8,000 characters at most) to someone known not to be a connection goes as an InMail with inmail on and an account that isn’t free (subject optional), and is skipped otherwise. Each step answers actionId, kind, status (done or skipped), outcome (sent; or already_connected, pending, not_invited, not_connected, no_credits, not_allowed), sent, accountId, accountName, contactId, at, and as it applies invitationId, chatId, messageId, networkDistance, text and note. An action LinkedIn refuses (they can’t be reached, Unipile doesn’t say whether it went) or one cancelled (its account was disconnected) fails the step. A contact on the do-not-contact list ends the run (exited) before anything is queued, and a run that ends however cancels its actions still queued. Pausing the workflow holds its queued actions until it’s on again. A step queues 100 actions at most. Test runs show what they’d send and queue nothing. LinkedIn request accepted (trigger.linkedin_connected, for one account or any) starts when someone connects with a member’s account, up to a few hours after they accept (Unipile learns of it by polling LinkedIn); its item has linkedin (accountId, accountName, providerId, profileUrl, source, connectedAt) and the contact. Goals and exit conditions can wait for it as “Connects on LinkedIn” (linkedin.connected), and an exit on a reply can name its channel ({ "event": "message.received", "channel": "linkedin" }).
The AI step writes something, sorts text into one of the categories given, or picks named details out of it, with the Acting role’s model in AI › Settings › Models, so it needs no account of its own: Claude on the workspace’s own Anthropic account while Anthropic is connected, otherwise GLM-4.7 Flash, whose calls count on the ai meter as the agent’s do, and the step fails once today’s AI limit is reached. What it reads is data, never instructions. A sort answers { category, text } (category is null if the answer named none), picking out answers { data, text } with every detail asked for, null where it found none.
Build a website (sites.build) builds a site from a prompt with the AI agent’s coding run, the same site change the agent makes (Site changes): a new site (target: "new", named from name, which can be an expression: it’s made into lowercase letters, digits and dashes, and numbered -2, -3 and on when it’s taken), or one of the workspace’s sites or APIs (target: "existing", site by id, from GET /api/v1/sites). The run writes the code, builds it and puts up a preview; the step waits for that (waitFor: "preview") or for the site to be live (waitFor: "live"), then answers changeId, siteId, site, new, status, live, url (the site’s own address), previewUrl, title, summary and pages. Going live follows AI › Settings as the agent’s changes do: at Auto it merges by itself, at Ask the card to approve opens in a chat of the member’s. A build that fails, or isn’t approved before its card runs out, fails the step with why.
It acts for the member who last published the workflow, as a playbook acts for its author: they need to be able to change sites (and reach the site, for a member limited to some). As with the agent’s own site changes, only a member’s say-so starts a build: a version published with an API key, by an app or by the agent builds nothing until a member publishes it. It needs Anthropic connected (Claude Code runs on the workspace’s own account), AI › Settings on with Site code at Ask or Auto, and counts on the agent’s coding runs a day. The prompt (3,500 characters at most) as written is the coding run’s instruction; values filled in from the run, such as a form’s answers, reach it as details about the site, never as instructions. A step builds 10 sites at most.
The templates library
Section titled “The templates library”GET /api/v1/automations/templates lists recipes, each with its nodes, its rules and what to set up: new lead follow-up, appointment reminders, review request, abandoned cart, birthday offer and win-back, and for the Newsletter (category Newsletter) a welcome series, re-engagement, a paid upgrade nudge and a referral thank-you. POST /api/v1/automations/templates/{id}/install adds one as a draft workflow, optionally in a folder, to change and turn on like any other.