Inspect Token
Verifies a JWT with a Sommatic AI credential (recommended) or a literal key.
Verifies a JWT signature and its time claims with the key you provide, and returns the claims and header. Without a key it only decodes the token and sends it to invalid.
How it works
- Resolves the config; leaves through
errorwithtoken is requiredwhentokenis empty. - Picks the key:
connection_idfirst, otherwise the literalsecret_key. - With no key, decodes the token without checking it and returns its claims and header on
invalid, never as valid. - Otherwise verifies the signature allowing only
algorithm(defaultHS256), and checksexpandnbf. - Valid: returns
{ valid: true, verified: true, payload, header }onout. Not valid: returns{ valid: false, verified: false, error }oninvalid.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-verify-approval-token",
"label": "Verify approval token",
"operator_slug": "token.inspect",
"operator_version": "2.0.0",
"config": {
"token": "{{ $json.token }}",
"connection_id": "pi-credential-xxxx",
"algorithm": "HS256"
}
}{
"ok": true,
"port": "out",
"data": {
"valid": true,
"verified": true,
"payload": {
"sub": "usr_123",
"role": "approver",
"iat": 1795724213,
"exp": 1795725113
},
"header": {
"alg": "HS256",
"typ": "JWT"
}
},
"meta": {
"crypto": {
"op": "jwtVerify",
"key_source": "credential",
"alias": "connection",
"credential_id": "pi-credential-xxxx",
"algorithm": "HS256",
"ok": true
},
"warnings": []
}
}Configuration
-
tokenstring Required -
connection_idstring Optional -
Sommatic AI credential resolved server-side (recommended). Accepts credentials of type `jwt-signing`.
-
secret_keystring Optional -
Verification secret or public key as a literal. Allowed, but it is stored in the flow, its version history and Git: prefer connection_id.
-
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 aspublic_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. -
algorithm - Exactly one algorithm is accepted. A token signed with any other algorithm goes to
invalid.
Output ports
out default The signature and time claims are valid.
{
"valid": true,
"verified": true,
"payload": {
"sub": "usr_123",
"role": "approver",
"iat": 1795724213,
"exp": 1795725113
},
"header": {
"alg": "HS256",
"typ": "JWT"
}
}invalid Verification failed (bad signature, expired, malformed, other algorithm), or no key is configured. Without a key the data also carries the unverified payload and header, and there is no meta.
{
"valid": false,
"verified": false,
"error": "jwt expired"
}error token is empty or the credential cannot be resolved.
{
"error": "token is required"
}In expressions
What a later node can read from this node's output with $("Inspect Token").item.json.<path> (write your node's label instead of Inspect 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 |
|---|---|---|
$("Inspect Token").item.json.valid | ||
$("Inspect Token").item.json.verified | ||
$("Inspect Token").item.json.payload | ||
$("Inspect Token").item.json.header | ||
$("Inspect Token").item.json.error | — | |
$("Inspect Token").item.json.payload.sub | — | |
$("Inspect Token").item.json.payload.role | — | |
$("Inspect Token").item.json.payload.iat | — | |
$("Inspect Token").item.json.payload.exp | — | |
$("Inspect Token").item.json.header.alg | — | |
$("Inspect Token").item.json.header.typ | — |
— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Errors
| Message | Port | Cause and fix |
|---|---|---|
token is required | error | token is empty. |
invalid signature | invalid | The token was signed with a different key. |
jwt expired | invalid | The exp claim is in the past. |
jwt malformed | invalid | The value is not a JWT (three base64url parts). |
invalid algorithm | invalid | The token header uses an algorithm other than algorithm. Set algorithm to the one the issuer uses. |
Signature not verified: no key configured | invalid | Neither connection_id nor secret_key is set, so the token was only decoded. |
credential binding 'connection' has no key usable for verify | invalid | 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
-
tokenstring Required -
connection_idstring Optional -
secret_keystring Optional -
algorithmstring Optional
Output contract
-
validboolean Optional -
verifiedboolean Optional -
payloadobject Optional -
headerobject Optional -
errorstring 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.inspect",
"name": "Inspect Token",
"category": "identity",
"version": "2.0.0",
"description": "Verifies a JWT with a Sommatic AI credential (recommended) or a literal key. Without a key the token is never reported as valid.",
"capabilities": [
"authn",
"jwt",
"crypto"
],
"config_schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"connection_id": {
"type": "string",
"title": "Verification 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": "Verification secret or public key as a literal. Allowed, but it is stored in the flow, its version history and Git: prefer connection_id."
},
"algorithm": {
"type": "string",
"default": "HS256",
"enum": [
"HS256",
"HS384",
"HS512",
"RS256",
"RS384",
"RS512",
"ES256",
"ES384",
"ES512"
]
}
},
"required": [
"token"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"connection_id": {
"type": "string"
},
"secret_key": {
"type": "string"
},
"algorithm": {
"type": "string"
}
},
"required": [
"token"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"valid": {
"type": "boolean"
},
"verified": {
"type": "boolean"
},
"payload": {
"type": "object"
},
"header": {
"type": "object"
},
"error": {
"type": "string"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Token Data",
"description": "Token is valid or decoded",
"is_default": true,
"supports_condition": true
},
{
"port_id": "invalid",
"label": "Invalid",
"description": "Verification failed",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Processing error",
"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": {
"token": {
"type": "string"
},
"connection_id": {
"type": "string",
"title": "Verification 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": "Verification secret or public key as a literal. Allowed, but it is stored in the flow, its version history and Git: prefer connection_id."
},
"algorithm": {
"type": "string",
"default": "HS256",
"enum": [
"HS256",
"HS384",
"HS512",
"RS256",
"RS384",
"RS512",
"ES256",
"ES384",
"ES512"
]
}
},
"required": [
"token"
]
}{
"type": "object",
"properties": {
"token": {
"type": "string"
},
"connection_id": {
"type": "string"
},
"secret_key": {
"type": "string"
},
"algorithm": {
"type": "string"
}
},
"required": [
"token"
]
}{
"type": "object",
"properties": {
"valid": {
"type": "boolean"
},
"verified": {
"type": "boolean"
},
"payload": {
"type": "object"
},
"header": {
"type": "object"
},
"error": {
"type": "string"
}
}
}[
{
"port_id": "out",
"label": "Token Data",
"description": "Token is valid or decoded",
"is_default": true,
"supports_condition": true
},
{
"port_id": "invalid",
"label": "Invalid",
"description": "Verification failed",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Processing error",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
sync- Stateful
- No
- Capabilities
authnjwtcrypto- Tags
jwtauth
Notes and limits
- The definition describes
outas "valid or decoded", but decoded-only tokens (no key) always go toinvalid. - Audience (
aud) and issuer (iss) are not checked: compare them yourself with aflow.ifonpayloadafterout. - 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