Reference · Tools

JWT

Sign, verify, and decode JSON Web Tokens (JWTs) using HMAC secrets or RSA/ECDSA/PS key pairs.

Action Development v1

The JWT node signs, verifies and decodes JSON Web Tokens using either an HMAC secret or an RSA, ECDSA or PS key pair. A typical build is minting a short-lived signed token to authenticate against a partner API, or verifying an inbound token before trusting the request that carried it.

Node type
Action
Parameters
7
Outputs
Output, Error
Credentials
JWT Credential

JWT

Sign, verify, and decode JSON Web Tokens.

Overview

JWT tool for creating, verifying, and decoding JSON Web Tokens. Supports HMAC (HS256/384/512), RSA (RS256/384/512), ECDSA (ES256/384/512), and RSA-PSS (PS256/384/512) algorithms. Sign creates a new token from claims, verify checks the signature and temporal claims, decode reads token contents without verification. All operations are local cryptographic computations with no external API calls.

Category: Development
Tool Name: jwt
Version: 1

Appearance: Icon: lucide-Shield | Color: #000000

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires JWT Credential credentials. See the Credentials Guide for setup instructions.

Operations

OperationValueDescription
DecodedecodeDecode a JWT without verifying the signature
SignsignCreate a new signed JWT from claims
VerifyverifyVerify a JWT signature and decode its payload

Parameters

Decode (decode)

ParameterTypeRequiredDefaultDescription
TokenstringYesThe JWT token to verify or decode. Supports expressions like {{ $json.token }}.

Sign (sign)

ParameterTypeRequiredDefaultDescription
Use JSON to Build PayloadbooleanNofalseWhether to use JSON to build the claims instead of structured fields.
Payload ClaimscollectionNo{}Standard JWT claims for the token payload. (shown when Use JSON to Build Payload is false)
— AudiencestringNoIdentifies the recipients that the JWT is intended for.
— Expires InnumberNo3600The lifetime of the token in seconds.
— IssuerstringNoIdentifies the principal that issued the JWT.
— JWT IDstringNoUnique identifier for the JWT.
— Not BeforenumberNo0The time in seconds before which the JWT must not be accepted for processing.
— SubjectstringNoIdentifies the principal that is the subject of the JWT.
Payload Claims (JSON)jsonNo{\n "my_field_1": "value 1",\n "my_field_2": "value 2"\n}\nClaims to add to the token in JSON format. Allows custom claims beyond the standard set. (shown when Use JSON to Build Payload is true)

Verify (verify)

ParameterTypeRequiredDefaultDescription
TokenstringYesThe JWT token to verify or decode. Supports expressions like {{ $json.token }}.

All Operations

ParameterTypeRequiredDefaultDescription
OptionscollectionNo{}Additional options for the JWT operation.
— Return Additional InfobooleanNofalseWhether to return the complete decoded token with header, payload, and signature, or just the payload. (shown when Operation is verify, decode)
— Ignore ExpirationbooleanNofalseWhether to ignore the expiration of the token. (shown when Operation is verify)
— Ignore Not Before ClaimbooleanNofalseWhether to ignore the not before claim of the token. (shown when Operation is verify)
— Clock TolerancenumberNo0Number of seconds to tolerate when checking the nbf and exp claims, to deal with small clock differences among different servers. (shown when Operation is verify)
— Key IDstringNoThe kid (key ID) claim is an optional header claim, used to specify the key for validating the signature. (shown when Operation is sign)
— Override AlgorithmoptionsNoHS256The algorithm to use for signing or verifying the token. Overrides the algorithm configured in credentials. (shown when Operation is sign, verify)
Options: ES256, ES384, ES512, HS256, HS384, HS512, PS256, PS384, PS512, RS256, RS384, RS512
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One output item per input item — no operation fans out. The result is merged onto the input item JSON: the fields that were already on the item pass through, and the node adds its own on top. Binary data is forwarded unchanged.

OperationWhat lands on the item
signtoken — the signed JWT string
verifypayload — the verified claims, or (with Return Additional Info on) the decoded token spread onto the item as header, payload and signature
decodepayload — the claims read without signature verification, or (with Return Additional Info on) header, payload and signature

When you sign with structured claims rather than JSON, the fields map onto the standard registered claim names: Audience becomes aud, Issuer becomes iss, Subject becomes sub, and JWT ID becomes jti. Expires In and Not Before are applied as signing options, so they surface in the token as exp and nbf. Use Payload Claims (JSON) when you need custom claims beyond that set.

Reference the result downstream by expression, e.g. {{ $json.token }} or {{ $json.payload.sub }}.

Usage Examples

  • Sign a JWT with custom claims and HS256 algorithm
  • Verify a JWT token and extract its payload
  • Decode a JWT without signature verification to inspect its contents
  • Create a JWT with RS256 using a PEM private key
  • Verify a JWT with expiration tolerance for clock skew

Example Configuration

Sign a token from the structured claim fields:

{
  "type": "jwt",
  "parameters": {
    "operation": "sign",
    "useJson": false,
    "claims": {
      "audience": "my-app",
      "issuer": "auth-service",
      "subject": "{{ $json.userId }}",
      "expiresIn": 3600
    },
    "options": {
      "algorithm": "HS256"
    }
  }
}

Sign a token with custom claims supplied as JSON:

{
  "type": "jwt",
  "parameters": {
    "operation": "sign",
    "useJson": true,
    "claimsJson": "{\n  \"sub\": \"{{ $json.userId }}\",\n  \"aud\": \"my-app\",\n  \"permissions\": [\"read\", \"write\"]\n}",
    "options": {
      "algorithm": "RS256",
      "kid": "signing-key-1"
    }
  }
}

Verify an incoming token, tolerating a few seconds of clock skew:

{
  "type": "jwt",
  "parameters": {
    "operation": "verify",
    "token": "{{ $json.token }}",
    "options": {
      "ignoreExpiration": false,
      "clockTolerance": 5
    }
  }
}

Decode a token without verifying it, returning the header as well:

{
  "type": "jwt",
  "parameters": {
    "operation": "decode",
    "token": "{{ $json.incomingToken }}",
    "options": {
      "complete": true
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Sign, verify, or decode JSON Web Tokens using HMAC or RSA/EC key pairs — use for authentication token creation, validation, and inspection.

Frequently asked questions

What is the difference between verify and decode?

Decode reads the claims without checking the signature; verify confirms the token was signed by the expected key. Never trust a decoded token you have not verified — decoding proves nothing about authenticity.

Which algorithms are supported?

HMAC secrets, plus RSA, ECDSA and PS key pairs, which covers the common HS, RS, ES and PS families.

Which credential does it need?

A JWT credential holding the secret or key material, so the key never has to be pasted into node parameters where it would sit in the workflow definition.

Can I use it to authenticate outbound API calls?

Yes — sign a token here and pass it into an HTTP Request node's header, which is the usual pattern for APIs expecting a signed JWT.

Build with the JWT node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need JWT Credential credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.