← All N8N workflows
Automation & utilitiesCodeIfOne ShotOne Shot SynchRespond To Webhook

x402

Configured with One Shot, One Shot Synch, Respond To Webhook, Webhook. Review the connections and setup before adapting this template.

Workflow preview
TriggerWebhookWebhookRoutingCheck for presence ofX-HEADERIfCodeDecode & ValidateX-PaymentCodeIntegrationSimulate PaymentOne ShotRoutingOn Successful PaymentSimulationIfIntegration1Shot API Submit & WaitOne Shot SynchRoutingEnsure Well FormattedPayment PayloadIfWeb / APIResponse: Missing orInvalid Payment HeadersRespond To WebhookWeb / APIResponse: PaymentInvalidRespond To WebhookWeb / APIResponse: 200 - PaymentSuccessfulRespond To Webhook

Node categories in this workflow

  • Trigger
  • Routing
  • Code
  • Integration
  • Web / API

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
WebhookTriggerWebhookSee node parameters
Check for presence of X-HEADERRoutingIfSee node parameters
Decode & Validate X-PaymentCodeCodeSee node parameters
Simulate PaymentIntegrationOne Shotsimulate
On Successful Payment SimulationRoutingIfSee node parameters
1Shot API Submit & WaitIntegrationOne Shot SynchSee node parameters
Ensure Well Formatted Payment PayloadRoutingIfSee node parameters
Response: Missing or Invalid Payment HeadersWeb / APIRespond To WebhookSee node parameters
Response: Payment InvalidWeb / APIRespond To WebhookSee node parameters
Response: 200 - Payment SuccessfulWeb / APIRespond To WebhookSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • oneShotOAuth2Api

Workflow notes

x402 Payment Endpoint

x402 Payment Endpoint

This workflow fragment can be used to monetize any workflow you can build in n8n by accepting stablecoin payments via an API call.

Learn more about the x402 payment protocol.

Watch the YouTube tutorial video.

Any ERC-20 on any EVM

Any ERC-20 on any EVM

With the 1Shot API node, you can accept any ERC-20 with the appropriate transferWithAuthorization methods.

Put your workflow down here

Put your workflow down here

Once the payment transaction has been confirmed, replace the Response: 200 - Payment Successful block with your workflow which responds to the user with the appropriate premium content.

Example Curl Command

Example Curl Command

You can test the webhook endpoint with a command like this (be sure to use a properly formatted x-payment header payload):

# swap out the URL here for you webhook URL endpoint
curl -X GET \
  https://n8n.1shotapi.dev/webhook-test/92c5ca23-99a7-437d-85da-84aef8bd2a25 \
  -H "x-payment: YOUR-BASE64-ENCODED-PAYMENT-PAYLOAD" \
  -H "User-Agent: CustomUserAgent/1.0" \
  -H "Accept: application/json"
Ensure Required Payment Details

Ensure Required Payment Details

Use this block to add/check for payment detail requirements like minimum payment amount.

x402

x402

Purpose and structure

This folder contains the x402 workflow. Its executable nodes use code, if, oneShot, oneShotSynch, respondToWebhook, webhook. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Webhook

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/1Shot-API/n8n-nodes-1shot/blob/099288d799a12a856e15f3f680ef0fd990e7cb43/x402.json MIT; preserve source notices.

More in Automation & utilities