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

# Scheduling and incoming webhooks

> Cron-scheduled workflows and receiving events from external systems.

Two launch modes: **scheduling** (periodic) and **incoming webhooks** (from external systems).

## Scheduled workflows

### Cron expression

Arya supports standard cron syntax:

```
minute hour day month day-of-week

0 9 * * 1      → Every Monday 9:00
0 */4 * * *    → Every 4 hours
30 18 * * 1-5  → Weekdays at 18:30
0 0 1 * *      → 1st of month at midnight
```

### Scope

A scheduled workflow can operate on:

* **The workspace** (1 execution per trigger, e.g. "send weekly team report")
* **A set of records** (1 execution per record, e.g. "for every invoice open >30 days send reminder")

<Steps>
  <Step title="Configure">
    **Scheduled** trigger type → cron expression + timezone + scope.
  </Step>

  <Step title="Test">
    Click **Run now** to test without waiting for the next slot.
  </Step>

  <Step title="Activate">
    Toggle Active. Workflow runs automatically.
  </Step>
</Steps>

### Practical examples

<AccordionGroup>
  <Accordion title="Weekly report">
    Every Monday 9:00 → query deal pipeline → generate chart → email to manager.
  </Accordion>

  <Accordion title="Duplicate cleanup">
    Every Sunday night → find duplicate contacts → notify HR for merge.
  </Accordion>

  <Accordion title="Customer birthdays">
    Every day 8:00 → find contacts with today's birthday → send personalised greeting.
  </Accordion>

  <Accordion title="Invoice reminders">
    Every day → invoices overdue 7/30/60 days → escalating reminder emails.
  </Accordion>

  <Accordion title="Expiry check">
    Every week → certifications expiring within 30 days → task to HR + employee email.
  </Accordion>
</AccordionGroup>

## Incoming webhooks

Allow external systems to trigger Arya workflows by calling an HTTP URL.

### Configuration

<Steps>
  <Step title="Create webhook trigger">
    **Incoming webhook** trigger → Arya generates unique URL:

    ```
    https://api.arya.so/webhooks/wh_abc123xyz
    ```
  </Step>

  <Step title="Set authentication">
    * **None**: anyone with URL can trigger (not recommended)
    * **Token**: `X-Webhook-Token: xxx` header
    * **HMAC**: body signature with secret key (most secure)
  </Step>

  <Step title="Define payload schema">
    Specify the expected JSON structure. Arya validates every call.

    ```json theme={null}
    {
      "contact": {
        "first_name": "string",
        "last_name": "string",
        "email": "string"
      },
      "source": "string"
    }
    ```
  </Step>

  <Step title="Test">
    Send a test call (Arya provides cURL example).

    ```bash theme={null}
    curl -X POST https://api.arya.so/webhooks/wh_abc123xyz \
      -H "X-Webhook-Token: xxx" \
      -H "Content-Type: application/json" \
      -d '{"contact": {"first_name": "Mario", ...}}'
    ```
  </Step>

  <Step title="Activate and share URL">
    Pass URL + schema to the calling system (Zapier, Make, partner, internal).
  </Step>
</Steps>

### Webhook use cases

<AccordionGroup>
  <Accordion title="Typeform form → Arya lead">
    Typeform submits → Arya webhook → create contact + add to list.
  </Accordion>

  <Accordion title="Zapier/Make orchestration">
    Zapier connects N systems → triggers Arya as one endpoint.
  </Accordion>

  <Accordion title="Internal ERP">
    ERP notes new order → calls Arya → create deal + update invoice.
  </Accordion>

  <Accordion title="Outreach tools (HeyReach, Instantly)">
    External outreach tools call Arya on lead reply → create record + assign to rep.
  </Accordion>
</AccordionGroup>

### Error handling

If the workflow fails, Arya responds to the webhook with:

* `200 OK` + body with error if you want the external system to see it
* `500 Error` if you want Zapier/Make to retry

Configurable in **Advanced → Error response**.

### Logging

Every webhook call is logged in **Webhook history**:

* Timestamp
* Source IP
* Received payload
* Sent response
* Triggered workflow (if any)

## Difference from exposed webhooks

* **Incoming webhooks** (this page): Arya receives from outside
* [**Exposed webhooks**](/en/automations/exposed-webhooks): Arya notifies outside (outbound)

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Can I pause a scheduled workflow without deleting it?">Yes, Active/Paused toggle. Resumes from next slot on reactivation.</Accordion>
  <Accordion title="Is the webhook URL secret?">Only if authenticated (token/HMAC). Without auth, it's public on the network and anyone can trigger.</Accordion>
  <Accordion title="How many webhooks can I receive per second?">100 req/sec per workspace rate limit, 500 req/sec on Enterprise. Beyond the limit Arya responds 429 with `Retry-After` header.</Accordion>
</AccordionGroup>
