n8n決済協調プロダクト: 1Shot APIとの連携
上級
これはCrypto Trading, Multimodal AI分野の自動化ワークフローで、27個のノードを含みます。主にIf, Code, Webhook, OneShot, OneShotSynchなどのノードを使用。 x402と1Shot APIを使用して、自ホスト型ブロックチェーン決済プロセッサーの作成
前提条件
- •HTTP Webhookエンドポイント(n8nが自動生成)
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "iOBvq8tJmbslKLvM",
"meta": {
"instanceId": "62f017ec8f130d172e2e5f39bbf09515036bfd403dfa60fe06f5ab14b78705d0",
"templateCredsSetupCompleted": true
},
"name": "n8n Facilitator with 1Shot API",
"tags": [
{
"id": "ChlnN7rtKHJMnWmM",
"name": "x402",
"createdAt": "2025-06-19T04:23:28.149Z",
"updatedAt": "2025-06-19T04:23:28.149Z"
}
],
"nodes": [
{
"id": "18ef87da-599a-4aa9-89cb-dab6ac024abe",
"name": "シミュレートペイメント",
"type": "n8n-nodes-1shot.oneShot",
"position": [
672,
32
],
"parameters": {
"params": "={\n \"from\": \"{{ $json.decodedXPayment.payload.authorization.from }}\",\n \"to\": \"{{ $json.decodedXPayment.payload.authorization.to }}\",\n \"value\": \"{{ $json.decodedXPayment.payload.authorization.value }}\",\n \"validAfter\": \"{{ $json.decodedXPayment.payload.authorization.validAfter }}\",\n \"validBefore\": \"{{ $json.decodedXPayment.payload.authorization.validBefore }}\",\n \"nonce\": \"{{ $json.decodedXPayment.payload.authorization.nonce }}\",\n \"signature\": \"{{ $json.decodedXPayment.payload.signature }}\"\n} ",
"operation": "simulate",
"contractMethodId": "={{ $json.paymentConfig.contractMethodId }}"
},
"credentials": {
"oneShotOAuth2Api": {
"id": "05rDRla9Nl1rkXlv",
"name": "x402 Facilitator"
}
},
"typeVersion": 1
},
{
"id": "68d961ac-3d63-40ff-aecb-acb5d3c8e8f4",
"name": "ペイメント設定を検索",
"type": "n8n-nodes-base.code",
"onError": "continueErrorOutput",
"position": [
224,
256
],
"parameters": {
"jsCode": "const fromToken = $input.first().json.body.paymentRequirements.asset;\nconst fromChain = $input.first().json.body.paymentRequirements.network;\n\nconst config = {\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\": {\n tokenAddress: \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n chain: \"8453\",\n name: \"USD Coin\",\n version: \"2\",\n contractMethodId: \"8445805a-0807-4ccf-a44d-6d4210a22787\",\n network: \"base-mainnet\"\n },\n \"0x036cbd53842c5426634e7929541ec2318f3dcf7e\": {\n tokenAddress: \"0x036cbd53842c5426634e7929541ec2318f3dcf7e\",\n chain: \"84532\",\n name: \"USDC\",\n version: \"2\",\n contractMethodId: \"adcf8d1f-1110-460a-9779-fe0bd1d9f9af\",\n network: \"base-sepolia\"\n },\n \"0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\": {\n tokenAddress: \"0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\",\n chain: \"43114\",\n name: \"USD Coin\",\n version: \"2\",\n contractMethodId: \"ed87ea0a-074a-487a-9f7e-226182d83a96\",\n network: \"avalanche\"\n },\n \"0xaf88d065e77c8cc2239327c5edb3a432268e5831\": {\n tokenAddress: \"0xaf88d065e77c8cc2239327c5edb3a432268e5831\",\n chain: \"42161\",\n name: \"USD Coin\",\n version: \"2\",\n contractMethodId: \"5c8e4b9b-b2f2-4882-9ca0-7fbc8b1d4d9f\",\n network: \"arbitrum\"\n }\n};\n\n\n\n// Check if fromToken exists in config\nif (!config[fromToken.toLowerCase()]) {\n throw new Error(`Token ${fromToken} not found in configuration`);\n}\n\n// Optionally you could also validate the chain if needed\nif (config[fromToken.toLowerCase()].network !== fromChain) {\n throw new Error(`Invalid chain for token ${fromToken} on <${fromChain}>`);\n}\n\n// Add the parsed JSON object to the input\n$input.first().json.paymentConfig = config[fromToken.toLowerCase()];\n\nreturn $input.all();\n\n"
},
"typeVersion": 2
},
{
"id": "d6d7add8-77b1-4083-9dbb-f4140e96dd56",
"name": "/verify",
"type": "n8n-nodes-base.webhook",
"position": [
-672,
416
],
"webhookId": "92c5ca23-99a7-437d-85da-84aef8bd2a25",
"parameters": {
"path": "/verify",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "734689a3-1a5a-4e75-aeff-0cfe1906147a",
"name": "/settle",
"type": "n8n-nodes-base.webhook",
"position": [
-672,
608
],
"webhookId": "92c5ca23-99a7-437d-85da-84aef8bd2a25",
"parameters": {
"path": "/settle",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "21939197-b339-42fc-94d8-2bbdb2442a0e",
"name": "決済レスポンス",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
896,
224
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "={\n \"success\": {{ $json.status === \"Success\" }},\n \"error\": {{ JSON.stringify($json.failureReason) }},\n \"txHash\": \"{{ $json.transactionHash }}\",\n \"networkId\": \"{{ $json.chainId }}\"\n}"
},
"typeVersion": 1.3
},
{
"id": "5fa377a6-f450-497d-bec0-ad19c08bdcfc",
"name": "検証レスポンス",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
896,
32
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "={\n \"isValid\": {{ $json.success }},\n \"invalidReason\": \"{{ $json.error.reason }}\"\n} "
},
"typeVersion": 1.3
},
{
"id": "3a22826f-7857-4e5b-9239-a504b6a4b918",
"name": "レスポンス: 不正なPOSTボディ (/verify)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
448,
752
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "{\n \"isValid\": false,\n \"invalidReason\": \"Incorrect or missing payload arguments\"\n}"
},
"typeVersion": 1.3
},
{
"id": "954e3c34-dad9-4c62-b5a6-97cff5a642dd",
"name": "レスポンス: 不正なPOSTボディ (/settle)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
448,
944
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "={\n \"success\": false,\n \"error\": \"Missing or incorrect POST body\",\n \"txHash\": null,\n \"networkId\": {{ JSON.stringify($json.body.paymentRequirements.network) }}\n}"
},
"typeVersion": 1.3
},
{
"id": "63d9fe6a-7618-429b-9e47-db9451542337",
"name": "1Shot API 送信&待機",
"type": "n8n-nodes-1shot.oneShotSynch",
"position": [
672,
224
],
"parameters": {
"params": "={\n \"from\": \"{{ $json.decodedXPayment.payload.authorization.from }}\",\n \"to\": \"{{ $json.decodedXPayment.payload.authorization.to }}\",\n \"value\": \"{{ $json.decodedXPayment.payload.authorization.value }}\",\n \"validAfter\": \"{{ $json.decodedXPayment.payload.authorization.validAfter }}\",\n \"validBefore\": \"{{ $json.decodedXPayment.payload.authorization.validBefore }}\",\n \"nonce\": \"{{ $json.decodedXPayment.payload.authorization.nonce }}\",\n \"signature\": \"{{ $json.decodedXPayment.payload.signature }}\"\n} ",
"additionalFields": {
"memo": "="
},
"contractMethodId": "={{ $json.paymentConfig.contractMethodId }}"
},
"credentials": {
"oneShotOAuth2Api": {
"id": "05rDRla9Nl1rkXlv",
"name": "x402 Facilitator"
}
},
"typeVersion": 1
},
{
"id": "019b8699-64d1-4404-9ba2-3c61a377fd8a",
"name": "POSTペイロードを確認",
"type": "n8n-nodes-base.if",
"position": [
-448,
512
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2ff83590-61f3-41d8-8500-a96103c3844c",
"operator": {
"type": "number",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.x402Version }}",
"rightValue": ""
},
{
"id": "a1971594-5bd9-4c77-96c3-da66c28ed23a",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentHeader }}",
"rightValue": ""
},
{
"id": "506da99c-4aea-47e9-b711-6597e3eeaf75",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.network }}",
"rightValue": ""
},
{
"id": "4b11ebb0-c7cc-4c38-9d80-1dcedfa3b147",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.scheme }}",
"rightValue": ""
},
{
"id": "7cce2b0e-8525-4441-aa04-6d57ed6a8c47",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.maxAmountRequired }}",
"rightValue": ""
},
{
"id": "bd4aa27f-9ecb-4cf5-9a6a-67455cb5a309",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.resource }}",
"rightValue": ""
},
{
"id": "622b8fa7-6d14-4898-bcd0-1e0120060b9e",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.payTo }}",
"rightValue": ""
},
{
"id": "84f191fc-48e9-40f7-9629-906e0ec3db31",
"operator": {
"type": "number",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.maxTimeoutSeconds }}",
"rightValue": ""
},
{
"id": "22538bd0-0f51-4994-8364-6a75c817dc7e",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.paymentRequirements.asset }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "1887a18e-8f12-4f91-b7d4-ca02de6c709b",
"name": "X-ペイメントをデコード&検証",
"type": "n8n-nodes-base.code",
"onError": "continueErrorOutput",
"position": [
-224,
448
],
"parameters": {
"jsCode": "try {\n // Decode the x-payment header from base64\n const xPaymentHeader = $input.first().json.body.paymentHeader;\n const decodedXPayment = Buffer.from(xPaymentHeader, 'base64').toString('utf-8');\n\n // Parse the decoded value into a JSON object\n const decodedXPaymentJson = JSON.parse(decodedXPayment);\n\n // Add the parsed JSON object to the input\n $input.first().json.decodedXPayment = decodedXPaymentJson;\n\n return $input.all();\n} catch (error) {\n // Return an error object if the token format is invalid\n return { error: \"invalid token format\" };\n}"
},
"typeVersion": 2
},
{
"id": "8255ba6a-3768-4fe6-8824-7f0f18dfbc85",
"name": "ペイメントペイロードを確保",
"type": "n8n-nodes-base.if",
"position": [
0,
304
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6666e1f6-5e99-49d4-9f9a-a5a35cde4f74",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.signature }}",
"rightValue": ""
},
{
"id": "f1e58e1f-e977-4a37-9d1d-c94ed8467787",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.authorization.from }}",
"rightValue": ""
},
{
"id": "94eb9519-6466-4c3c-a3bb-4f2eff188cc9",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.authorization.to }}",
"rightValue": ""
},
{
"id": "3c3f1f2f-e660-4259-a5c1-bc574cf4f5d7",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.authorization.value }}",
"rightValue": ""
},
{
"id": "691b9638-8932-41fb-9b1f-ab0be7db9dec",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.authorization.validAfter }}",
"rightValue": ""
},
{
"id": "04ec5919-4052-48b3-818e-a8e6544a30f9",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.authorization.validBefore }}",
"rightValue": ""
},
{
"id": "612ed984-94ff-436e-b149-d1aa75971b06",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.authorization.validBefore }}",
"rightValue": "="
},
{
"id": "5c3db8f1-8fbb-49a4-9547-fdcb3dd5b275",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.decodedXPayment.payload.signature }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "08df85be-f602-4710-a9ca-340e39c9816b",
"name": "/supported",
"type": "n8n-nodes-base.webhook",
"position": [
-688,
1200
],
"webhookId": "4ccebeff-20bd-4871-bb2e-f29f45d35878",
"parameters": {
"path": "supported",
"options": {},
"responseMode": "responseNode"
},
"typeVersion": 2.1
},
{
"id": "5b19047c-d340-4cfc-9909-b7589b999a32",
"name": "レスポンス: サポートネットワークを返す",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
-64,
1184
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "={\n \"kinds\": {{ JSON.stringify($json.kinds) }}\n} "
},
"typeVersion": 1.3
},
{
"id": "ac002b7a-108e-49b6-bed7-16bb8477fe6e",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1168,
16
],
"parameters": {
"width": 448,
"height": 416,
"content": "## /verify endpoint\n\nThe verify endpoint will check that the given `x-payment` header, given the associated `paymentRequirements`, are valid. If the payment details are valid this endpoint will return:\n```sh\n{\n isValid: true;\n invalidReason: \"\";\n}\n```\n\nIf the endpoint determines that the payment details will revert for any reason, it will return with: \n```sh\n{\n isValid: false;\n invalidReason: \"<Smart Contract Revert Error>\";\n}\n```\n"
},
"typeVersion": 1
},
{
"id": "cea02913-92b7-45aa-bcb2-1e3dc3a8d588",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1168,
528
],
"parameters": {
"width": 432,
"height": 464,
"content": "## /settle endpoint\n\nThe settle endpoint will attempt to settle a payment to the target blockchain given the provided payment details. If this endpoint fails it will return with:\n```sh\n{\n success: false;\n error: \"<Reason for tx failure>\";\n txHash: null;\n networkId: \"<network name>\";\n}\n```\n\nIf the endpoint succeeds, it will return:\n```sh\n{\n success: true;\n error: null;\n txHash: \"transaction hash\";\n networkId: \"<network name>\";\n}\n```\n"
},
"typeVersion": 1
},
{
"id": "9cd414aa-fa67-4c9c-8177-6a3568d43af2",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
-16
],
"parameters": {
"width": 320,
"height": 240,
"content": "## Accepted Tokens Config \n\nYou must edit the payment tokens `config` object in the `Lookup Payments Config` node with the token details of all tokens you wish to support with your facilitator. \n\n*Important*: Be sure to import the contract methods for the appropriate tokens into your 1Shot API node. "
},
"typeVersion": 1
},
{
"id": "e788d782-8540-437e-b86f-a3d14c75b885",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1152,
1152
],
"parameters": {
"width": 416,
"height": 320,
"content": "## /supported endpoint\n\nThis endpoint returns the blockchain networks your facilitator will support. Its output looks like: \n\n\n```sh\n{\n kinds: [\n {\n \"scheme\": string,\n \"network\": string,\n }\n ]\n}\n```"
},
"typeVersion": 1
},
{
"id": "64f5beea-0952-4aca-9c07-3ec3eef523d8",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-464,
1440
],
"parameters": {
"width": 384,
"height": 176,
"content": "## Supported Networks Config\n\nBe sure to update the `Supported Networks Config` node to reflect the networks you have configured your 1Shot API account to process. "
},
"typeVersion": 1
},
{
"id": "c6292c7a-cac1-46be-a61c-b80170aa1a93",
"name": "サポートネットワーク設定",
"type": "n8n-nodes-base.code",
"onError": "continueErrorOutput",
"position": [
-400,
1200
],
"parameters": {
"jsCode": "const input = $input.all()\n\n\nconst kinds = [\n {\n \"scheme\": \"exact\",\n \"network\": \"base-mainnet\",\n },\n {\n \"scheme\": \"exact\",\n \"network\": \"base-sepolia\",\n },\n {\n \"scheme\": \"exact\",\n \"network\": \"avalanche\",\n },\n {\n \"scheme\": \"exact\",\n \"network\": \"avalanche-fuji\",\n },\n {\n \"scheme\": \"exact\",\n \"network\": \"arbitrum-mainnet\",\n },\n {\n \"scheme\": \"exact\",\n \"network\": \"ethereum-mainnet\",\n }\n ]\n\n$input.first().json.kinds = kinds;\n\nreturn $input.all();\n"
},
"typeVersion": 2
},
{
"id": "9fb18099-c840-47af-b8d6-9f8107c05dd3",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2000,
400
],
"parameters": {
"width": 688,
"height": 544,
"content": "## Example Facilitator Curl Request\n\nHere is a complete curl request you can use to test your node:\n\n```sh\ncurl -X POST \\\n https://n8n.1shotapi.dev/webhook-test/settle \\\n -H \"User-Agent: CustomUserAgent/1.0\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"x402Version\": 1,\n \"paymentHeader\": \"eyJ4NDAyVmVyc2lvbiI6IjEiLCJzY2hlbWUiOiJleGFjdCIsIm5ldHdvcmsiOiJiYXNlLXNlcG9saWEiLCJwYXlsb2FkIjp7ImF1dGhvcml6YXRpb24iOnsiZnJvbSI6IjB4NTU2ODBDNkI2OUQ1OThDMEI0MkY5M0NENTNERkYzRDIwZTA2OWI1YiIsInRvIjoiMHg5ZkVhZDhCMTlDMDQ0QzJmNDA0ZGFjMzhCOTI1RWExNkFEYWEyOTU0IiwidmFsdWUiOiIxMDAwMDAiLCJ2YWxpZEFmdGVyIjoiMTc1NTEzMjk4NCIsInZhbGlkQmVmb3JlIjoiMTc1NTEzMzE2NCIsIm5vbmNlIjoiMHgxNjRjZjNjMDFlMzgwOTk4MTdmYzNkM2I5YTlkYjYzZGNiYTFjNWMwZDExOGU4ZThhNjIwODAwNmQ5M2U1ODYyIn0sInNpZ25hdHVyZSI6IjB4YjdlNzMxMjViY2QxNDU2MTJlZThkZWY1MDQ1M2I3YzhmMWY1NjQzZmYzZDRlMjcxMWVkNTdiNGRhNjY3NDRhMjdmM2Q1YWRmY2EyMDA4MDI4M2YxODVmODQ0YWJiYWI0YjczYWM2N2JjZDU0NmJiM2ViZDc3M2RlYzczODFlNGUxYyJ9fQ==\",\n \"paymentRequirements\": {\n \"scheme\": \"exact\",\n \"network\": \"base-sepolia\",\n \"maxAmountRequired\": \"5000000\",\n \"resource\": \"https://n8n.1shotapi.dev/webhook/gas-station\",\n \"description\": \"Swap stablecoins for gas tokens\",\n \"mimeType\": \"\",\n \"payTo\": \"0x9fEad8B19C044C2f404dac38B925Ea16ADaa2954\",\n \"maxTimeoutSeconds\": 150,\n \"asset\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"extra\": {\n \"name\": \"USD Coin\",\n \"version\": \"version\"\n }\n }\n }'\n```"
},
"typeVersion": 1
},
{
"id": "7c69392c-d424-4639-909e-588a5f17cee2",
"name": "付箋6",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
-240
],
"parameters": {
"width": 432,
"height": 224,
"content": "## Create Your 1Shot API Credential\n\nDon't forget to authenticate against your 1Shot API business by creating an n8n credential. \n\nClick on one of the 1Shot API nodes, then click on `Credential to connect with`, then enter you API key, secret, and business id. "
},
"typeVersion": 1
},
{
"id": "c94b228a-7a92-45b9-9ded-fb34186eaa2e",
"name": "不正なペイロードまたはヘッダー",
"type": "n8n-nodes-base.if",
"position": [
224,
784
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "185b904e-d8c8-4605-9075-531abc762b46",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.webhookUrl }}",
"rightValue": "verify"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "efa373f0-b6ae-4a46-b6f2-ec6f6d2eae67",
"name": "未対応トークン",
"type": "n8n-nodes-base.if",
"position": [
448,
512
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "185b904e-d8c8-4605-9075-531abc762b46",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.webhookUrl }}",
"rightValue": "verify"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "c7ab50fa-af33-41ec-849f-a53f7ec7b54d",
"name": "verifyまたはsettle",
"type": "n8n-nodes-base.if",
"position": [
448,
128
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "185b904e-d8c8-4605-9075-531abc762b46",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.webhookUrl }}",
"rightValue": "verify"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "b80d7ac0-14bc-4dfb-936b-a09c3644ba53",
"name": "レスポンス: 未対応トークン (/verify)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
672,
416
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "{\n \"isValid\": false,\n \"invalidReason\": \"Unsupported payment token\"\n}"
},
"typeVersion": 1.3
},
{
"id": "f57b3f31-2f63-482a-87d7-cdeb8884f0de",
"name": "レスポンス: 未対応トークン (/settle)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
672,
608
],
"parameters": {
"options": {
"responseCode": 402
},
"respondWith": "json",
"responseBody": "={\n \"success\": false,\n \"error\": \"Unsupported payment token\",\n \"txHash\": null,\n \"networkId\": {{ JSON.stringify(($json.error.match(/<([^>]+)>/) || [])[1] || null) }}\n} "
},
"typeVersion": 1.3
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "60b6cf16-d04b-4402-ac83-a827312a8edf",
"connections": {
"734689a3-1a5a-4e75-aeff-0cfe1906147a": {
"main": [
[
{
"node": "019b8699-64d1-4404-9ba2-3c61a377fd8a",
"type": "main",
"index": 0
}
]
]
},
"d6d7add8-77b1-4083-9dbb-f4140e96dd56": {
"main": [
[
{
"node": "019b8699-64d1-4404-9ba2-3c61a377fd8a",
"type": "main",
"index": 0
}
]
]
},
"08df85be-f602-4710-a9ca-340e39c9816b": {
"main": [
[
{
"node": "c6292c7a-cac1-46be-a61c-b80170aa1a93",
"type": "main",
"index": 0
}
]
]
},
"18ef87da-599a-4aa9-89cb-dab6ac024abe": {
"main": [
[
{
"node": "5fa377a6-f450-497d-bec0-ad19c08bdcfc",
"type": "main",
"index": 0
}
]
]
},
"c7ab50fa-af33-41ec-849f-a53f7ec7b54d": {
"main": [
[
{
"node": "18ef87da-599a-4aa9-89cb-dab6ac024abe",
"type": "main",
"index": 0
}
],
[
{
"node": "63d9fe6a-7618-429b-9e47-db9451542337",
"type": "main",
"index": 0
}
]
]
},
"efa373f0-b6ae-4a46-b6f2-ec6f6d2eae67": {
"main": [
[
{
"node": "b80d7ac0-14bc-4dfb-936b-a09c3644ba53",
"type": "main",
"index": 0
}
],
[
{
"node": "f57b3f31-2f63-482a-87d7-cdeb8884f0de",
"type": "main",
"index": 0
}
]
]
},
"019b8699-64d1-4404-9ba2-3c61a377fd8a": {
"main": [
[
{
"node": "1887a18e-8f12-4f91-b7d4-ca02de6c709b",
"type": "main",
"index": 0
}
],
[
{
"node": "c94b228a-7a92-45b9-9ded-fb34186eaa2e",
"type": "main",
"index": 0
}
]
]
},
"c94b228a-7a92-45b9-9ded-fb34186eaa2e": {
"main": [
[
{
"node": "3a22826f-7857-4e5b-9239-a504b6a4b918",
"type": "main",
"index": 0
}
],
[
{
"node": "954e3c34-dad9-4c62-b5a6-97cff5a642dd",
"type": "main",
"index": 0
}
]
]
},
"8255ba6a-3768-4fe6-8824-7f0f18dfbc85": {
"main": [
[
{
"node": "68d961ac-3d63-40ff-aecb-acb5d3c8e8f4",
"type": "main",
"index": 0
}
],
[
{
"node": "c94b228a-7a92-45b9-9ded-fb34186eaa2e",
"type": "main",
"index": 0
}
]
]
},
"68d961ac-3d63-40ff-aecb-acb5d3c8e8f4": {
"main": [
[
{
"node": "c7ab50fa-af33-41ec-849f-a53f7ec7b54d",
"type": "main",
"index": 0
}
],
[
{
"node": "efa373f0-b6ae-4a46-b6f2-ec6f6d2eae67",
"type": "main",
"index": 0
}
]
]
},
"63d9fe6a-7618-429b-9e47-db9451542337": {
"main": [
[
{
"node": "21939197-b339-42fc-94d8-2bbdb2442a0e",
"type": "main",
"index": 0
}
],
[
{
"node": "21939197-b339-42fc-94d8-2bbdb2442a0e",
"type": "main",
"index": 0
}
]
]
},
"c6292c7a-cac1-46be-a61c-b80170aa1a93": {
"main": [
[
{
"node": "5b19047c-d340-4cfc-9909-b7589b999a32",
"type": "main",
"index": 0
}
]
]
},
"1887a18e-8f12-4f91-b7d4-ca02de6c709b": {
"main": [
[
{
"node": "8255ba6a-3768-4fe6-8824-7f0f18dfbc85",
"type": "main",
"index": 0
}
],
[
{
"node": "c94b228a-7a92-45b9-9ded-fb34186eaa2e",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - 仮想通貨取引, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Uniswap V3 を使用した DCA
Uniswap V3と1Shot APIでドルコスト平均法を使ってトークン購入を自動化
Code
One Shot
Telegram
+
Code
One Shot
Telegram
14 ノード1Shot API
仮想通貨取引
Aave収益最適化(設定サブフローなし)
1Shot APIとTelegramを使用した財布とAave間のUSDC残高管理の自動化
If
Code
Switch
+
If
Code
Switch
24 ノード1Shot API
コンテンツ作成
Uniswap V3 レンジトレーダー (バージョン 2)
Uniswap V3、Telegramアラート、MetaMaskdelegationを使用した自動インデックス取引
If
Code
Switch
+
If
Code
Switch
41 ノード1Shot API
その他
CoinGeckoとExchangeRate-APIを使用してBTC-ETH価格と為替レートAPIを作成
CoinGeckoとExchangeRate-APIを使用してBTC/ETH価格とドル為替レートAPIを作成
Code
Merge
Webhook
+
Code
Merge
Webhook
7 ノードDavid Olusola
仮想通貨取引
AI駆動の食品注文処理システム、Facebook Messenger、Googleスプレッドシート、カレンダーとの統合
AI駆動の食品注文処理システム、Facebook Messenger、Googleスプレッドシート、カレンダーとの統合
If
Code
Webhook
+
If
Code
Webhook
26 ノードHans Wilhelm Radam
リードナーチャリング
財務・会計向けAI駆動型請求書リマインダーと支払い追跡ツール
財務・会計業務向けに設計されたAIベースの請求書リマインダーと支払い追跡ツール
If
Set
Code
+
If
Set
Code
35 ノードOneclick AI Squad
請求書処理