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

# Create automation

> Crea una nueva automatización en gu1 indicando trigger, condiciones, acciones y grafo de nodos; el motor valida la sinergia del flujo.

## Endpoint

```
POST https://api.gu1.ai/automations
Content-Type: application/json
```

## Body (main fields)

<ParamField body="name" type="string" required>
  Display name
</ParamField>

<ParamField body="type" type="string">
  `realtime` (default) | `scheduled`
</ParamField>

<ParamField body="triggerType" type="string" required>
  Valid engine trigger (e.g. `manual_execution`, `investigation_created`, `scheduled`, …)
</ParamField>

<ParamField body="triggerConfig" type="object">
  Trigger-specific config (schedule, filters, etc.)
</ParamField>

<ParamField body="conditions" type="array">
  Condition objects: `field`, `operator`, `value`
</ParamField>

<ParamField body="actions" type="array">
  Legacy flat list: `{ type, config }`
</ParamField>

<ParamField body="steps" type="array">
  `{ conditions, actions, waitAfterStep? }[]`
</ParamField>

<ParamField body="graph" type="object">
  `{ nodes[], edges[] }` — nodes: `trigger` | `condition` | `action`; edges may include `sourceHandle`: `true` | `false`. Must include at least one **trigger** node.
</ParamField>

<ParamField body="layout" type="object">
  Optional node positions for the builder UI
</ParamField>

<ParamField body="enabled" type="boolean">
  Default `true`
</ParamField>

## Response

**201** — `{ "automation": { ... } }`

**400** — validation or synergy error (`synergyErrors` may be present)
