Skip to main content

Multi-chain token swap relayer with Li.Fi

Workflow preview

Workflow preview
100%
Multi-chain token swap relayer with Li.Fi preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Swap Tokens with Li.Fi The growing popularity of agentic payments has lead to the development of protocols like x402 where agents and humans can pay fo...

Best for

  • Crypto Trading automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.respondtowebhook, n8n-nodes-1shot.oneshotsynch, n8n-nodes-base.if, n8n-nodes-1shot.oneshot, n8n-nodes-base.webhook, n8n-nodes-base.httprequest, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by 1Shot API.

Original n8n.io source

1.1 Workflow description

Title
Multi-chain token swap relayer with Li.Fi
Workflow name
Multi-chain token swap relayer with Li.Fi

Swap Tokens with Li.Fi

The growing popularity of agentic payments has lead to the development of protocols like x402 where agents and humans can pay for internet resources over standard http protocols using stablecoins.

This workflow lets you run your own swap relayer where callers can provide an x402-compatible payment header and a desired destination network to instantly receive gas tokens. This setup is trust minimized - user's have the following guarantees:

  1. They will be the receiver of the swap.
  2. Only the amount of tokens the authorized will be swapped.

Setup

In order to run this relayer workflow, you will need an account on 1Shot API. You must then import the 1Shot Gas Station contract into your business for any chain you wish to support with your relayer.

Next, follow the directions in the worflow sticky notes to update the Payment Configs for the tokens you wish to support swaps for. Lastly, distrubute your webhook api endpoint to your users.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Response: 200 - Payment Successful

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.3

Block 4 - 1Shot API Submit & Wait

Type / Role
n8n-nodes-1shot.oneShotSynch - oneShotSynch
Config choices
Version 1

Block 5 - On Successful Payment Simulation

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - Simulate Payment

Type / Role
n8n-nodes-1shot.oneShot - oneShot
Config choices
Version 1

Block 7 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 8 - Fetch Li.Fi Quote

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Response: Missing or Invalid Request Body Params

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.3

Block 10 - Response: Failed to Get Quote

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.3

Block 11 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Validate & Verify X-Payment Header

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Payment Token Configs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Validate & Verify POST Body

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Response: No X-Payment Header2

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.3

Block 18 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Response: Verify Failed

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.3

Block 20 - Response: Settle Failed

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.3

3. Summary Table

Workflow Multi-chain token swap relayer with Li.Fi
Complexity advanced
Nodes 20
Categories Crypto Trading, Multimodal AI
Author 1Shot API
Published 10 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7206/7206.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Multi-chain token swap relayer with Li.Fi do?

Swap Tokens with Li.Fi The growing popularity of agentic payments has lead to the development of protocols like x402 where agents and humans can pay fo...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading, Multimodal AI use case.