> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailofly.com/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

<ParamField body="name" type="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"`.
</ParamField>

<ParamField body="status" type="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!
</ParamField>

<ParamField body="steps" type="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`).
</ParamField>

<ParamField body="connections" type="object[]">
  The train tracks linking your blocks! Each track tells Mailofly: *"When you finish block `from`, jump straight to block `to`."*
</ParamField>

### Response

<ResponseField name="object" type="string">
  Always says `"automation"` so your program knows it received a real automation object.
</ResponseField>

<ResponseField name="id" type="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!
</ResponseField>

<RequestExample>
  ```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);
  ```
</RequestExample>

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


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