Para configuração rápida você pode usar nosso workflow de exemplo para entender o funcionamento e ver suas primeiras execuções usando o nó oficial Zapster API.
{
"name": "Command Router Example",
"nodes": [
{
"parameters": {
"events": [
"message.received"
],
"mode": "multiOutput",
"instancesIds": []
},
"type": "@zapsterapi/n8n-nodes-zapsterapi.zapsterApiTrigger",
"typeVersion": 1,
"position": [
-256,
16
],
"id": "f68a3c32-b1b6-4571-ae1d-8025bb42a31b",
"name": "Zapster API Trigger",
"webhookId": "2d4965a3-8815-4559-8e67-a02878f31a94",
"credentials": {}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "d0101f06-ec7b-496e-aafc-47738c3b0d77",
"leftValue": "={{ $json.data.recipient.type }}",
"rightValue": "chat",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-32,
16
],
"id": "e239310a-41cb-4cb7-9e33-2b53e32593af",
"name": "Is individual chat?"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
192,
128
],
"id": "ac9b8cf6-bd0d-46f5-a1db-e179d5b4b53d",
"name": "Ignoring groups!"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $('Zapster API Trigger').item.json.data.content.text }}",
"rightValue": "!ping",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "3465f5e4-474a-4578-9912-8b397195aa90"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "PING"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "cb1012bb-13a9-431f-99ee-b76a0374bb3b",
"leftValue": "={{ $('Zapster API Trigger').item.json.data.content.text }}",
"rightValue": "!image",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "IMAGE"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "aa27fc15-c330-4005-a709-6d23e0887abc",
"leftValue": "={{ $('Zapster API Trigger').item.json.data.content.text }}",
"rightValue": "!audio",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "AUDIO"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "17c24136-f19b-4d3f-ad5f-dfdd4133aa4e",
"leftValue": "={{ $('Zapster API Trigger').item.json.data.content.text }}",
"rightValue": "!video",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "VIDEO"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
192,
-128
],
"id": "c46c4512-90eb-4f82-b891-c65f1bd16b99",
"name": "Command Router"
},
{
"parameters": {
"resource": "message",
"operation": "sendMessage",
"instanceId": {
"__rl": true,
"value": "={{ $('Zapster API Trigger').item.json.instance_id }}",
"mode": "id"
},
"recipient": "={{ $('Zapster API Trigger').item.json.data.recipient.id }}",
"textMessage": "=pong! ({{DateTime.now().toUTC().diffTo(DateTime.fromISO($('Zapster API Trigger').item.json.created_at), 'seconds')}} segundos)",
"media": {},
"buttons": {},
"buttonSettingsNotice": "",
"additionalFields": {
"replyToMessageId": "={{ $('Zapster API Trigger').item.json.data.id }}"
}
},
"type": "@zapsterapi/n8n-nodes-zapsterapi.zapsterApi",
"typeVersion": 1,
"position": [
416,
-384
],
"id": "1216aa2f-0a84-4132-a5df-efa967360efb",
"name": "Send Pong",
"credentials": {
"zapsterApiCredentials": {
"id": "wuHiiZoHeCfPHogg",
"name": "Token PRD"
}
}
},
{
"parameters": {
"resource": "message",
"instanceId": {
"__rl": true,
"value": "={{ $('Zapster API Trigger').item.json.instance_id }}",
"mode": "id"
},
"recipient": "={{ $('Zapster API Trigger').item.json.data.recipient.id }}",
"textMessage": "={{DateTime.now().toUTC().diffTo(DateTime.fromISO($('Zapster API Trigger').item.json.created_at), 'seconds')}} segundos",
"media": {
"mediaSettings": {
"mediaUrl": "https://images.unsplash.com/photo-1485827404703-89b55fcc595e?q=80&w=600&format=jpeg&fit=crop"
}
},
"additionalFields": {
"replyToMessageId": "={{ $('Zapster API Trigger').item.json.data.id }}"
}
},
"type": "@zapsterapi/n8n-nodes-zapsterapi.zapsterApi",
"typeVersion": 1,
"position": [
416,
-192
],
"id": "c606f22c-b7b8-4225-a974-7ac1d1b8710f",
"name": "Send an Image",
"credentials": {
"zapsterApiCredentials": {
"id": "wuHiiZoHeCfPHogg",
"name": "Token PRD"
}
}
},
{
"parameters": {
"resource": "message",
"instanceId": {
"__rl": true,
"value": "={{ $('Zapster API Trigger').item.json.instance_id }}",
"mode": "id"
},
"recipient": "={{ $('Zapster API Trigger').item.json.data.recipient.id }}",
"textMessage": "=",
"media": {
"mediaSettings": {
"mediaUrl": "https://zapsterapi-samples.s3.us-east-1.amazonaws.com/file_example_MP3_700KB.mp3"
}
},
"additionalFields": {
"replyToMessageId": "={{ $('Zapster API Trigger').item.json.data.id }}"
}
},
"type": "@zapsterapi/n8n-nodes-zapsterapi.zapsterApi",
"typeVersion": 1,
"position": [
416,
0
],
"id": "8d95ad69-b25f-46a6-9dab-d785b46b5d68",
"name": "Send an Audio",
"credentials": {
"zapsterApiCredentials": {
"id": "wuHiiZoHeCfPHogg",
"name": "Token PRD"
}
}
},
{
"parameters": {
"resource": "message",
"instanceId": {
"__rl": true,
"value": "={{ $('Zapster API Trigger').item.json.instance_id }}",
"mode": "id"
},
"recipient": "={{ $('Zapster API Trigger').item.json.data.recipient.id }}",
"textMessage": "={{DateTime.now().toUTC().diffTo(DateTime.fromISO($('Zapster API Trigger').item.json.created_at), 'seconds')}} segundos",
"media": {
"mediaSettings": {
"mediaUrl": "https://zapsterapi-samples.s3.us-east-1.amazonaws.com/file_example_MP4_480_1_5MG.mp4"
}
},
"additionalFields": {
"replyToMessageId": "={{ $('Zapster API Trigger').item.json.data.id }}"
}
},
"type": "@zapsterapi/n8n-nodes-zapsterapi.zapsterApi",
"typeVersion": 1,
"position": [
416,
192
],
"id": "58488c81-2bba-4452-9f09-1ddde51065bc",
"name": "Send an Video",
"credentials": {}
}
],
"pinData": {},
"connections": {
"Zapster API Trigger": {
"main": [
[
{
"node": "Is individual chat?",
"type": "main",
"index": 0
}
]
]
},
"Is individual chat?": {
"main": [
[
{
"node": "Command Router",
"type": "main",
"index": 0
}
],
[
{
"node": "Ignoring groups!",
"type": "main",
"index": 0
}
]
]
},
"Command Router": {
"main": [
[
{
"node": "Send Pong",
"type": "main",
"index": 0
}
],
[
{
"node": "Send an Image",
"type": "main",
"index": 0
}
],
[
{
"node": "Send an Audio",
"type": "main",
"index": 0
}
],
[
{
"node": "Send an Video",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "f02e13c4-c1aa-44d1-ad86-30a69b18a3b9",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "8602b2bf44dc37aa465fd74e0c6e1e64728f18e19e18f668e104fcbd0de5c15e"
},
"id": "9gbFMRrQyoRhnHsP",
"tags": [
{
"createdAt": "2025-01-12T17:55:58.580Z",
"updatedAt": "2025-01-12T17:55:58.580Z",
"id": "btVxbPPBIKHgWFJE",
"name": "dev"
}
]
}