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

# Create Workflow

> Create a new automation workflow with triggers and steps.

## Authentication

Requires a JWT token or API key in the `Authorization` header.

```bash theme={"dark"}
Authorization: Bearer YOUR_TOKEN
```

## Request

<ParamField body="name" type="string" required>
  Workflow display name.
</ParamField>

<ParamField body="description" type="string">
  Human-readable description of what the workflow does.
</ParamField>

<ParamField body="trigger" type="object">
  Trigger configuration. Types: `manual`, `webhook`, `schedule`, `file_upload`, `monitor_event`.
</ParamField>

<ParamField body="steps" type="array">
  Array of step objects. Each step has `id`, `type`, and `config`.
</ParamField>

<ParamField body="template_id" type="string">
  Clone from an existing template instead of defining steps manually.
</ParamField>

### Step types

| Type             | Description                  |
| ---------------- | ---------------------------- |
| `email_lookup`   | Enrich an email address      |
| `phone_lookup`   | Enrich a phone number        |
| `company_lookup` | Enrich a company             |
| `domain_lookup`  | Domain intelligence          |
| `ip_lookup`      | IP geolocation & threat data |
| `darkweb_lookup` | Dark web breach search       |
| `condition`      | Branch logic (if/else)       |
| `delay`          | Wait before continuing       |
| `webhook`        | Send HTTP request            |
| `transform`      | Transform data between steps |

### Example request

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl -X POST "https://encrata.com/api/workflows" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Lead enrichment pipeline",
      "trigger": { "type": "webhook" },
      "steps": [
        { "id": "step1", "type": "email_lookup", "config": { "field": "email" } },
        { "id": "step2", "type": "condition", "config": { "expression": "step1.company != null" } },
        { "id": "step3", "type": "company_lookup", "config": { "field": "step1.company" } },
        { "id": "step4", "type": "webhook", "config": { "url": "https://hooks.example.com/enriched", "method": "POST" } }
      ]
    }'
  ```

  ```python Python theme={"dark"}
  import requests

  resp = requests.post(
      "https://encrata.com/api/workflows",
      headers={"Authorization": "Bearer YOUR_TOKEN"},
      json={
          "name": "Lead enrichment pipeline",
          "trigger": {"type": "webhook"},
          "steps": [
              {"id": "step1", "type": "email_lookup", "config": {"field": "email"}},
              {"id": "step2", "type": "company_lookup", "config": {"field": "step1.company"}},
          ],
      },
  )
  print(resp.json())
  ```
</CodeGroup>

## Response

Returns the created workflow object.

```json theme={"dark"}
{
  "id": "wf_abc123",
  "name": "Lead enrichment pipeline",
  "status": "active",
  "trigger": { "type": "webhook" },
  "steps": [...],
  "webhook_url": "https://encrata.com/api/workflows/ingest/tok_xyz789",
  "created_at": "2026-06-01T10:00:00Z"
}
```
