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

# Workflow Webhooks

> Trigger workflows via webhooks and handle external data.

Webhooks allow external services to trigger and feed data into workflows.

## Webhook Trigger

Every workflow gets a unique webhook endpoint:

```
https://noorle.com/v1/workflows/{workflow_id}/webhook
```

POST data to trigger workflow:

```bash theme={null}
curl -X POST https://noorle.com/v1/workflows/{id}/webhook \
  -H "Content-Type: application/json" \
  -d '{"data": "input"}'
```

## Webhook Payload Schema

Define what data webhook accepts:

```json theme={null}
{
  "type": "object",
  "properties": {
    "name": {"type": "string"},
    "email": {"type": "string"},
    "priority": {"type": "string", "enum": ["high", "low"]}
  },
  "required": ["name", "email"]
}
```

## Mapping Webhook Data

Data from webhook available in workflow:

```
[Start/Webhook] 
  ↓
[Agent] Use webhook data
  ├─ Agent receives: name, email, priority
  └─ Processes based on priority
```

## Example: Support Ticket

External system creates support ticket:

```bash theme={null}
POST /workflows/{id}/webhook
{
  "ticket_id": "TKT-123",
  "customer": "Alice",
  "issue": "Login not working",
  "priority": "high"
}
```

Workflow:

1. Start receives ticket data
2. Agent analyzes issue
3. Manager approves solution
4. Webhook sends back ticket update

## Webhook Security

Secure webhooks with:

**API Key Header:**

```
Authorization: Bearer sk-...
```

**HMAC Signature:**

```
X-Webhook-Signature: sha256=...
```

**IP Whitelist:**
Only allow specific IPs

## Webhook Response

Workflow sends response back to caller:

```json theme={null}
{
  "status": "success",
  "workflow_id": "...",
  "execution_id": "...",
  "output": {...}
}
```

Caller can poll for status or listen for completion.

## Webhook Nodes

Also add Webhook nodes in workflow to receive data mid-process:

1. Add Webhook node
2. Pause workflow at that point
3. External service POSTs data
4. Workflow resumes

## Example: External Approval

External approval system:

```bash theme={null}
POST /workflows/{id}/webhook/approval_node
{
  "approved": true,
  "reviewer": "john@company.com",
  "notes": "Looks good"
}
```

Workflow resumes with approval.

## Polling vs Event

**Webhook (Event-based):**

* External service triggers
* Immediate
* Real-time

**Polling (Request-based):**

* Workflow checks for status
* Delayed
* Periodic

Use webhooks for real-time.

## Testing Webhooks

Test in Console:

1. **Workflows** > Select workflow
2. Click **Test**
3. Enter sample webhook payload
4. See workflow execute

## Rate Limits

* 100 webhook triggers/hour
* Parallel executions: 10
* Payload size: 25MB
* Timeout: 30 seconds to first response

## Next Steps

* [Workflows Overview](/docs/run/workflows/overview)
* [Node Types](/docs/run/workflows/node-types)
* [Human Approval](/docs/run/workflows/human-in-the-loop)
