Onchainautomationwith n8n

n8n diagram

Monetize N8n Workflows With X402

Using the 1Shot API node in series with the 1Shot API Submit & Wait node, you can monetize any workflow that you can build in n8n using the x402 payment protocol.

The workflow template is available here. Download the JSON file and import it into your n8n workflow instance.

n8n nodes

n8n Nodes

Workflows in n8n are built using nodes which allow n8n to make API calls to external services. The 1Shot API node lets you read from and write to smart contracts on any EVM-compatible blockchain in your n8n workflows. You can find our node implementation on GitHub.

n8n install

Installing The 1Shot API n8n Node

You can install the 1Shot API n8n node by searching for n8n-nodes-1shot in the community nodes package manager. Click install, then you should be able to find the 1Shot API node in your n8n workflow search bar.

Node Types

You can install the 1Shot API n8n node. It supports three node types:

1Shot API:

1Shot API:

This is the primary node you’ll likely use. It contains functions for reading and writing to smart contracts, as well as reading your transaction history and wallet states.

1Shot API Webhook:

1Shot API Webhook:

This is an entrypoint node; it can trigger workflows in n8n. This node requires you input a webhook public key so that callbacks can be authenticated.

1Shot API Submit & Wait:

1Shot API Submit & Wait:

This node executes contract methods and blocks the workflow until the transaction is confirmed or failed. You can handle success and failure logic separately.