bling.refresh-token-due
Scans active Bling connections, refreshes any whose access_token expires within window_minutes. Designed to be invoked on a schedule so tokens never silently expire mid-API call.
Cron-style sweep that refreshes Bling tokens nearing expiry.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-bling |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Org to scan. Required even though the scan is org-scoped — workflow engine resolves session per-org. |
window_minutes | integer | No | — | Refresh tokens expiring within this many minutes. Default 30. |
actor | string | No | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Org to scan. Required even though the scan is org-scoped — workflow engine resolves session per-org. |
window_minutes | integer | No | — | Refresh tokens expiring within this many minutes. Default 30. |
actor | string | No | — | — |
scanned_count | integer | No | — | Total Bling connections found in the organization |
eligible_count | integer | No | — | Count within the refresh window |
refreshed_count | integer | No | — | Successful refresh-token workflow runs |
failed_count | integer | No | — | — |
results | json | No | — | [{connection_uuid, workflow_uuid, status, expires_at}, ...] |
started_at | string | No | — | — |
completed_at | string | No | — | — |
failure_reason | string | No | — | — |
failed_at | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | scan | Scheduled scan started |
completed | No | Yes | Yes | — | Scan completed |
failed | No | Yes | No | — | Scan failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
initiated | scan | completed | — |
initiated | fail | failed | — |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "bling.refresh-token-due",
"initial_data": {
"organization_uuid": "value"
}
}