For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/api/workflow/automations/post-api-workflow-v1automations.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.
Create automation
1import { Reloop } from "reloop-email";2
3const reloop = new Reloop({ apiKey: "rl_123456789" });4
5const { automation, automationError } = await reloop.automations.create({6 name: "Welcome",7 status: "active",8 steps: [9 { key: "start", type: "trigger", config: { eventName: "user.signed_up" } },10 { key: "is_pro", type: "condition", config: { type: "rule", field: "trigger.plan", operator: "eq", value: "pro" } },11 { key: "welcome_pro", type: "send_email", config: { template: { id: "tmpl_123456789" } } },12 { key: "wait", type: "delay", config: { amount: 1, unit: "days" } },13 { key: "welcome_free", type: "send_email", config: { template: { id: "tmpl_987654321" } } },14 ],15 connections: [16 { from: "start", to: "is_pro" },17 { from: "is_pro", to: "welcome_pro", type: "condition_met" },18 { from: "is_pro", to: "wait", type: "condition_not_met" },19 { from: "wait", to: "welcome_free" },20 ],21});22if (automationError) throw automationError;1{2 "id": "auto_123456789",3 "organizationId": "org_123456789",4 "name": "Welcome",5 "description": "Greets new sign-ups",6 "status": "active",7 "triggerEvent": "trigger.user.signed_up",8 "steps": [9 {10 "key": "start",11 "type": "trigger",12 "config": {13 "eventName": "trigger.user.signed_up"14 }15 },16 {17 "key": "is_pro",18 "type": "condition",19 "config": {20 "type": "rule",21 "field": "trigger.plan",22 "operator": "eq",23 "value": "pro"24 }25 },26 {27 "key": "welcome_pro",28 "type": "send_email",29 "config": {30 "template": {31 "id": "tmpl_123456789"32 }33 }34 },35 {36 "key": "wait",37 "type": "delay",38 "config": {39 "amount": 1,40 "unit": "days"41 }42 },43 {44 "key": "welcome_free",45 "type": "send_email",46 "config": {47 "template": {48 "id": "tmpl_987654321"49 }50 }51 }52 ],53 "connections": [54 {55 "from": "start",56 "to": "is_pro",57 "type": "default"58 },59 {60 "from": "is_pro",61 "to": "welcome_pro",62 "type": "condition_met"63 },64 {65 "from": "is_pro",66 "to": "wait",67 "type": "condition_not_met"68 },69 {70 "from": "wait",71 "to": "welcome_free",72 "type": "default"73 }74 ],75 "graph": {76 "nodes": [],77 "edges": []78 },79 "activeVersionId": "autov_123456789",80 "createdAt": "2026-03-23T10:00:00.000Z",81 "updatedAt": "2026-03-23T10:00:00.000Z"82}Body Parameters
Automation name
- Minimum length:
1 - Maximum length:
255
Optional description
- Maximum length:
2000
Possible values: draft | active
The steps, with exactly one trigger. Can be left out to create an empty draft.
Unique key for this step, used by connections (1-64 letters, numbers, _ or -).
"trigger", "send_email", "delay" or "condition".
trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: "rule", field, operator, value } or { type: "and" | "or", rules }.
How the steps link together, by step key.
Key of the step this connection leaves.
Key of the step it leads to.
"default" (the default), or "condition_met" / "condition_not_met" from a condition step.
Was this page helpful?