neon.auth.anonymous_token ​
Mint a Managed Better Auth anonymous JWT for Neon Data API calls
Mint a short-lived anonymous JWT for Neon Data API (Managed Better Auth).
Resolves the Auth base URL via GET …/auth when auth_base_url is omitted, then calls GET {auth_base_url}/token/anonymous (no Neon API key on that call).
Inputs:
- auth_base_url: optional absolute Neon Auth URL (…/auth).
- OR connection_uuid + neon_project_id + neon_branch_id to resolve it.
Outputs (terminal state_data):
- jwt: str (sensitive) — anonymous Bearer JWT for Data API
- auth_base_url: str — Auth URL used
- expires_at: int|null — unix expiry when provided by Neon Auth
Compensation: none (token is short-lived; discard after use). Do not log or persist jwt beyond the immediate composition step.
Plugin required when resolving Auth URL: context.get_plugin("neon").
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-neon |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | Cloud connection (required when auth_base_url omitted) |
neon_project_id | string | No | — | Neon project ID (with connection_uuid when resolving) |
neon_branch_id | string | No | — | Neon branch ID (with connection_uuid when resolving) |
auth_base_url | string | No | — | Managed Better Auth base URL from neon.auth.get |
timeout_seconds | integer | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | — |
neon_project_id | string | No | — | — |
neon_branch_id | string | No | — | — |
auth_base_url | string | No | — | — |
timeout_seconds | integer | No | — | — |
jwt | string | No | — | Anonymous Data API JWT (scrub after use) |
expires_at | integer | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "neon.auth.anonymous_token",
"initial_data": {
"connection_uuid": "value",
"neon_project_id": "value",
"neon_branch_id": "value",
"auth_base_url": "value"
}
}