Issue Token
Issues a JWT signed with a Sommatic AI credential (recommended) or a literal secret.
Signs a JWT with the claims you provide and an expiry of ttl_sec seconds. Supports HS256/384/512, RS256/384/512 and ES256/384/512; the key comes from a jwt-signing credential or a literal secret_key.
How it works
- Resolves the config. Claims come from
payload; when the node has nopayloadconfigured, the node input item is used as the claims. - Leaves through
errorwithpayload is requiredwhen the claims are missing or not an object. - Uses
ttl_secwhen it is a positive number, otherwise 3600 seconds. - Picks the key:
connection_idfirst, otherwise the literalsecret_key. - Signs with
algorithm(defaultHS256); the token getsiatandexpclaims. - Returns
{ token, expires_at }onout, withmeta.cryptoandmeta.warnings.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-issue-approval-token",
"label": "Issue approval token",
"operator_slug": "token.issue",
"operator_version": "2.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"payload": {
"sub": "{{ $json.user_id }}",
"role": "approver"
},
"ttl_sec": 900,
"algorithm": "HS256"
}
}{
"ok": true,
"port": "out",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfMTIzIiwicm9sZSI6ImFwcHJvdmVyIiwiaWF0IjoxNzk1NzI0MjEzLCJleHAiOjE3OTU3MjUxMTN9.<signature>",
"expires_at": "2026-11-26T15:19:05.000Z"
},
"meta": {
"crypto": {
"op": "jwtSign",
"key_source": "credential",
"alias": "connection",
"credential_id": "pi-credential-xxxx",
"algorithm": "HS256",
"ok": true
},
"warnings": []
}
}Configuration
-
connection_idstring Optional -
Sommatic AI credential resolved server-side (recommended). Accepts credentials of type `jwt-signing`.
-
secret_keystring Optional -
Signing secret or private key as a literal. Allowed, but it is stored in the flow, its version history and Git: prefer connection_id.
-
payloadobject Required -
Token claims
-
ttl_secinteger Optional -
algorithmstring Optional
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
connection_id - Takes precedence over
secret_key. Resolved on the server when the node runs. A string secret is used as the key; an object secret is read asprivate_key, thensecret, thenkey. -
secret_key - A literal key works, but it is stored in the flow, its version history and Git, and
meta.warningsreports it on every run. Preferconnection_id. -
payload - Optional in practice: when it is not configured, the whole input item becomes the claims. Configure it explicitly to avoid signing fields you did not intend to.
-
ttl_sec - Zero, negative or non-numeric values fall back to 3600. Every token expires; there is no option for tokens without
exp.
Output ports
out default The token was signed.
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfMTIzIiwicm9sZSI6ImFwcHJvdmVyIiwiaWF0IjoxNzk1NzI0MjEzLCJleHAiOjE3OTU3MjUxMTN9.<signature>",
"expires_at": "2026-11-26T15:19:05.000Z"
}error Claims are missing, the algorithm or key is not valid, or the credential cannot be resolved.
{
"error": "Unsupported JWT algorithm: PS256"
}In expressions
What a later node can read from this node's output with $("Issue Token").item.json.<path> (write your node's label instead of Issue Token). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Issue Token").item.json.token | ||
$("Issue Token").item.json.expires_at |
Errors
| Message | Port | Cause and fix |
|---|---|---|
payload is required | error | payload resolved to something that is not an object (a string, for example from mixed text). |
Unsupported JWT algorithm: <algorithm> | error | algorithm is not one of the nine listed values. |
Bad "options.expiresIn" option the payload already has an "exp" property. | error | The claims already contain exp. Remove it: the expiry always comes from ttl_sec. |
secretOrPrivateKey must be an asymmetric key when using <algorithm> | error | An RS* or ES* algorithm was chosen with a shared secret. Use a PEM private key of the matching type. |
A key is required: pass { credential: "<alias>" } (recommended) or { key } | error | Neither connection_id nor the literal key field is set. Select a credential in connection_id. |
credential binding 'connection' has no key usable for sign | error | The credential resolved, but its secret is empty or is an object without a usable field. Store the key as a string, or as an object with the field this operation reads (see connection_id). |
Failed to resolve connection <connection_id>: <detail> | error | The credential id does not exist or is not available to this workflow. Check the id and the credential type. |
Input contract
-
connection_idstring Optional -
secret_keystring Optional -
payloadobject Required -
ttl_secinteger Optional -
algorithmstring Optional
Output contract
-
tokenstring Optional -
expires_atstring Optional
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "token.issue",
"name": "Issue Token",
"category": "identity",
"version": "2.0.0",
"description": "Issues a JWT signed with a Sommatic AI credential (recommended) or a literal secret.",
"capabilities": [
"authn",
"jwt",
"crypto"
],
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Signing credential",
"description": "Sommatic AI credential resolved server-side (recommended). Accepts credentials of type `jwt-signing`.",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"jwt-signing"
]
}
},
"secret_key": {
"type": "string",
"ui_widget": "password",
"x-literal-secret": true,
"description": "Signing secret or private key as a literal. Allowed, but it is stored in the flow, its version history and Git: prefer connection_id."
},
"payload": {
"type": "object",
"description": "Token claims"
},
"ttl_sec": {
"type": "integer",
"default": 3600
},
"algorithm": {
"type": "string",
"default": "HS256",
"enum": [
"HS256",
"HS384",
"HS512",
"RS256",
"RS384",
"RS512",
"ES256",
"ES384",
"ES512"
]
}
},
"required": [
"payload"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"secret_key": {
"type": "string"
},
"payload": {
"type": "object"
},
"ttl_sec": {
"type": "integer"
},
"algorithm": {
"type": "string"
}
},
"required": [
"payload"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"expires_at": {
"type": "string"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Token",
"description": "Issued Token",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Issuance failed",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "sync",
"required_resources": [],
"compatible_worker_pools": [
"standard"
],
"tags": [
"jwt",
"auth"
],
"is_stateful": false,
"publisher": {
"identity": "org_veripass",
"profile": {
"name": "Veripass",
"verified": true,
"url": "https://me.veripass.com/veripass",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Signing credential",
"description": "Sommatic AI credential resolved server-side (recommended). Accepts credentials of type `jwt-signing`.",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"jwt-signing"
]
}
},
"secret_key": {
"type": "string",
"ui_widget": "password",
"x-literal-secret": true,
"description": "Signing secret or private key as a literal. Allowed, but it is stored in the flow, its version history and Git: prefer connection_id."
},
"payload": {
"type": "object",
"description": "Token claims"
},
"ttl_sec": {
"type": "integer",
"default": 3600
},
"algorithm": {
"type": "string",
"default": "HS256",
"enum": [
"HS256",
"HS384",
"HS512",
"RS256",
"RS384",
"RS512",
"ES256",
"ES384",
"ES512"
]
}
},
"required": [
"payload"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"secret_key": {
"type": "string"
},
"payload": {
"type": "object"
},
"ttl_sec": {
"type": "integer"
},
"algorithm": {
"type": "string"
}
},
"required": [
"payload"
]
}{
"type": "object",
"properties": {
"token": {
"type": "string"
},
"expires_at": {
"type": "string"
}
}
}[
{
"port_id": "out",
"label": "Token",
"description": "Issued Token",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Issuance failed",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
sync- Stateful
- No
- Capabilities
authnjwtcrypto- Tags
jwtauth
Notes and limits
expires_atis computed from the worker clock right after signing, so it can differ from the tokenexpby a few milliseconds.- Audience, issuer and subject cannot be set as options: put
aud,issorsubin the claims if you need them. - Leaving through
errordoes not fail the run: the engine follows the edges wired toerror, and if there are none the branch simply ends.
Reviewed against the orchestrator code · 31e874b · 2026-11-26