{
  "name": "Forward Chatwoot Messages to WhatsApp via Evolution API with Media Support",
  "nodes": [
    {
      "id": "b4822297-d783-40cd-bf18-1a6f0e6810ff",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -3040,
        880
      ]
    },
    {
      "id": "312e21b2-e354-4e7f-89ae-09e2275b551f",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -2128,
        896
      ]
    },
    {
      "id": "6dda1da0-0a6b-437a-8b1a-dbd3741c2b7b",
      "name": "Gateway",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1872,
        608
      ]
    },
    {
      "id": "d18c977e-b2ac-44a7-b549-e688ee194e89",
      "name": "Possui texto?",
      "type": "n8n-nodes-base.if",
      "position": [
        -592,
        1216
      ]
    },
    {
      "id": "0f353380-8619-4afe-aaf2-7e8086fe82a4",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2832,
        880
      ]
    },
    {
      "id": "6ab998d5-482d-4aee-af87-db414f313936",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        336
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "6424524a-5001-4a8a-994f-697ec1567ef6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1984,
        400
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8acb8387-0ba2-403a-aa0d-c8c3ac76362e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2432,
        400
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "432312be-45da-4166-a231-af60a2e4a9ad",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "78293e7e-5a6f-4922-be9d-73850538d957",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3120,
        672
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "e7f3356b-89d0-4a41-bab6-11b3f1eb3a56",
      "name": "Check if message is private",
      "type": "n8n-nodes-base.if",
      "position": [
        -2336,
        640
      ]
    },
    {
      "id": "ee05ff9e-32ba-44f5-a635-0507571eb359",
      "name": "Has attachment?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1456,
        624
      ]
    },
    {
      "id": "eed49873-5ff8-4864-be1e-0c1dbbdb7935",
      "name": "Array of attachments",
      "type": "n8n-nodes-base.code",
      "position": [
        -576,
        240
      ]
    },
    {
      "id": "5e81b55f-631c-4d88-9123-5d2da8672063",
      "name": "Send message text",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        880,
        1216
      ]
    },
    {
      "id": "31b9f881-e48e-4ba1-8594-f4461cf7059a",
      "name": "Send video message",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        880,
        960
      ]
    },
    {
      "id": "45454744-a936-4992-b656-fabb4e96e085",
      "name": "Send audio message",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        896,
        736
      ]
    },
    {
      "id": "c90e33a2-de5e-4bbb-ae44-30040f94ecc6",
      "name": "Send image message",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        896,
        528
      ]
    },
    {
      "id": "df9cb908-9b6e-42f3-b5ed-3fc5e416580d",
      "name": "Send document message",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        896,
        304
      ]
    },
    {
      "id": "9dd6f7a1-dd6f-4095-95a3-dbeb46c65d18",
      "name": "Check attachment file type",
      "type": "n8n-nodes-base.switch",
      "position": [
        208,
        256
      ]
    },
    {
      "id": "d304f7ca-685d-4c20-a400-c9e62e6c2850",
      "name": "Loop array of attachments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -16,
        240
      ]
    },
    {
      "id": "5acb48f5-17e2-46ad-b42a-ad456629039e",
      "name": "Object message",
      "type": "n8n-nodes-base.code",
      "position": [
        -2560,
        640
      ]
    },
    {
      "id": "dbd8e3fe-deb9-4677-88df-3f076bfe078f",
      "name": "Send text - Satisfaction Survey (Link chatwoot)",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        -1568,
        1056
      ]
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Object message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gateway": {
      "main": [
        [],
        [
          {
            "node": "Has attachment?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send text - Satisfaction Survey (Link chatwoot)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Possui texto?": {
      "main": [
        [
          {
            "node": "Send message text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Object message": {
      "main": [
        [
          {
            "node": "Check if message is private",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has attachment?": {
      "main": [
        [
          {
            "node": "Array of attachments",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Possui texto?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send audio message": {
      "main": [
        [
          {
            "node": "Loop array of attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send image message": {
      "main": [
        [
          {
            "node": "Loop array of attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send video message": {
      "main": [
        [
          {
            "node": "Loop array of attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Array of attachments": {
      "main": [
        [
          {
            "node": "Loop array of attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send document message": {
      "main": [
        [
          {
            "node": "Loop array of attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop array of attachments": {
      "main": [
        [],
        [
          {
            "node": "Check attachment file type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check attachment file type": {
      "main": [
        [
          {
            "node": "Send document message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send image message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send audio message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send video message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if message is private": {
      "main": [
        [
          {
            "node": "Gateway",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}