> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build a New Robot Flow

> Tell Mailofly to assemble a brand-new automated email journey from scratch!

Ready to put together an automatic helper? Send this request to give Mailofly the blueprint of your new workflow!

You hand us a friendly name, your Lego blocks (`steps`), and the train tracks tying them together (`connections`), and Mailofly will assemble it in a flash.

### Body

**name** `string` *required*

What do you want to call this helper? Give it a fun nickname you can easily recognize, like `"Super Welcome Wagon"` or `"Order High-Five"`.

**status** `string`

Should your robot start working immediately?

* `"disabled"` *(Default)*: Puts it in quiet draft mode so you can double-check everything first.
* `"enabled"`: Turns it live right away!

**steps** `object[]`

The colorful building blocks that make up your journey! Each block has a unique `key` (nickname), a `type` (like `trigger`, `delay`, `send_email`), and its own little settings backpack (`config`).

**connections** `object[]`

The train tracks linking your blocks! Each track tells Mailofly: *"When you finish block `from`, jump straight to block `to`."*

### Response

**object** `string`

Always says `"automation"` so your program knows it received a real automation object.

**id** `string`

The unique ID badge Mailofly stamped on your new robot, like `"auto_12345"`. Keep this safe so you can edit or run it later!

```bash cURL theme={null}
curl -X POST 'https://api.mailofly.com/automations' \
  -H 'Authorization: Bearer mf_live_xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Super Welcome Wagon",
    "status": "disabled",
    "steps": [
      {
        "key": "doorbell",
        "type": "trigger",
        "config": { "event_name": "user.signup" }
      },
      {
        "key": "welcome_letter",
        "type": "send_email",
        "config": {
          "template": { "id": "tpl_welcome_letter" }
        }
      }
    ],
    "connections": [
      { "from": "doorbell", "to": "welcome_letter" }
    ]
  }'
```

```javascript Node.js theme={null}
import { Mailofly } from "@mailofly/node";

const mailofly = new Mailofly("mf_live_xxxxxxxx");

const robot = await mailofly.automations.create({
  name: "Super Welcome Wagon",
  status: "disabled",
  steps: [
    {
      key: "doorbell",
      type: "trigger",
      config: { event_name: "user.signup" }
    },
    {
      key: "welcome_letter",
      type: "send_email",
      config: {
        template: { id: "tpl_welcome_letter" }
      }
    }
  ],
  connections: [
    { from: "doorbell", to: "welcome_letter" }
  ]
});

console.log("Assembled robot ID:", robot.id);
```

```json 201 Created theme={null}
{
  "object": "automation",
  "id": "auto_9b83b384-3c66-4f81-a201-3829028198f1"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.