> ## Documentation Index
> Fetch the complete documentation index at: https://glide-9da73dea.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# payroll.run

> Kick a payroll batch. Requires V2 payroll infra (Sprint 3-4); returns blocked_by_dep if unavailable, matching PLAN.md hero-skill dependency chain.

Kick a payroll batch. Requires V2 payroll infra (Sprint 3-4); returns blocked\_by\_dep if unavailable, matching PLAN.md hero-skill dependency chain.

## Metadata

| Field                    | Value               |
| ------------------------ | ------------------- |
| Name                     | `payroll.run`       |
| Category                 | `write`             |
| Required scope           | `payments:initiate` |
| Idempotency key required | yes                 |

## Annotations

| Annotation              | Value         |
| ----------------------- | ------------- |
| Title                   | Run Payroll   |
| Read-only               | no            |
| Destructive             | yes           |
| Idempotent              | yes           |
| Open-world              | no            |
| Requires human approval | yes (step-up) |

## Input schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schedule_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "override_payment_date": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128
    }
  },
  "required": [
    "schedule_id",
    "idempotency_key"
  ],
  "additionalProperties": false
}
```

## Output schema

```json theme={null}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "batch_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "recipient_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "total_cents": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "pending_co_sign",
        "broadcasting",
        "blocked_by_dep"
      ]
    },
    "enqueued_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    }
  },
  "required": [
    "batch_id",
    "recipient_count",
    "total_cents",
    "status",
    "enqueued_at"
  ],
  "additionalProperties": false
}
```

## Auth

Caller's grant must include the `payments:initiate` scope. Grants whose scope set is a superset of the required scope are accepted.

## Request examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://mcp.glide.co/mcp/write \
    -H "Authorization: Bearer $GLIDE_GRANT_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "payroll.run",
      "params": {
        "schedule_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
        "idempotency_key": "payroll-june-2026-run-001"
      }
    }'
  ```

  ```ts TypeScript theme={null}
  import { GlideClient } from './glide-client';

  const client = new GlideClient({ grantToken: process.env.GLIDE_GRANT_TOKEN! });

  const result = await client.call('payroll.run', {
    schedule_id: 'f6a7b8c9-d0e1-2345-fabc-456789012345',
    idempotency_key: 'payroll-june-2026-run-001',
  });

  if (result.status === 'blocked_by_dep') {
    console.warn('V2 payroll infra not yet available on this environment');
  } else {
    console.log(`Batch ${result.batch_id} queued for ${result.recipient_count} recipients ($${(result.total_cents / 100).toFixed(2)} total)`);
  }
  ```

  ```python Python theme={null}
  from glide_client import GlideClient
  import os

  client = GlideClient(grant_token=os.environ["GLIDE_GRANT_TOKEN"])

  result = client.call("payroll.run", {
      "schedule_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
      "idempotency_key": "payroll-june-2026-run-001",
  })

  print(result["status"], result["batch_id"], result["recipient_count"])
  ```
</CodeGroup>

## Response examples

Success — batch queued pending co-signer:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "batch_id": "a7b8c9d0-e1f2-3456-abcd-567890123456",
    "recipient_count": 42,
    "total_cents": 18750000,
    "status": "pending_co_sign",
    "enqueued_at": "2026-05-04T07:00:00Z"
  }
}
```

V2 payroll infra not yet available:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32006,
    "message": "payroll.run depends on V2 payroll infra (Sprint 3-4); not yet shipped on this environment",
    "data": { "reason_id": "payroll_v2_blocked" }
  }
}
```

Schedule belongs to a different tenant:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32001,
    "message": "payroll schedule f6a7b8c9-d0e1-2345-fabc-456789012345 is not owned by the calling tenant",
    "data": { "reason_id": "schedule_tenant_mismatch" }
  }
}
```

## Errors

| Code     | Name               | Cause                                                                                                                             | Remediation                                                                      |
| -------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `-32600` | Invalid request    | Malformed JSON-RPC envelope                                                                                                       | Check `method`, `jsonrpc`, and `id` fields                                       |
| `-32602` | Invalid params     | `schedule_id` not a valid UUID; schedule has zero active recipients (`schedule_empty`); schedule not found (`schedule_not_found`) | Verify the `schedule_id` exists and has at least one recipient                   |
| `-32001` | Unauthorized       | Schedule belongs to a different tenant (`schedule_tenant_mismatch`), or missing/expired grant token                               | Confirm the `schedule_id` was created under the same entity as the calling grant |
| `-32002` | Policy denied      | Grant missing `payments:initiate` scope                                                                                           | Issue a new grant with the required scope                                        |
| `-32006` | Vendor unavailable | V2 payroll infra not shipped on this environment (`payroll_v2_blocked`)                                                           | Wait for Sprint 3-4 rollout; monitor the changelog                               |
| `-32004` | Rate limited       | Too many batch starts in a short window                                                                                           | Back off by `retry_after_seconds` in the error `data`                            |
| `-32603` | Internal error     | Batch enqueue failed                                                                                                              | Retry with the same `idempotency_key`; the call is idempotent                    |
