{
  "name": "My workflow 3",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "60771fe4-2ece-4d57-8d1b-a8ce2f7f49ce",
        "responseMode": "streaming",
        "options": {}
      },
      "id": "850cf274-7722-4ccb-b61d-c5e74bfccca2",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -1968,
        256
      ],
      "webhookId": "60771fe4-2ece-4d57-8d1b-a8ce2f7f49ce"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d4abdb53-1c83-4d40-916d-cf2ce8127ddc",
              "name": "endereco_completo",
              "value": "={{' ' + $json.nome_rua + ' '+$json.municipio_uf+ ', Brasil' }}",
              "type": "string"
            },
            {
              "id": "8406526c-6600-4ecd-a769-04fc4dbafe2e",
              "name": "pesquisa_brasao",
              "value": "={{ 'brasão oficial município ' + $json.municipio_uf }}",
              "type": "string"
            },
            {
              "id": "4243e1e2-eac6-482e-af07-a287da491c20",
              "name": "pesquisa_equipamento",
              "value": "={{ $json.nome_equipamento + ' ' + $json.codigo_equipamento + ' ' + $json.tipo_equipamento + ' ' + $json.municipio_uf }}",
              "type": "string"
            },
            {
              "id": "f9ebdea2-5730-4582-84db-fc13568007ac",
              "name": "mapa_lat",
              "value": "=-22.603348",
              "type": "string"
            },
            {
              "id": "b76e41b5-15ac-4681-9be7-156e868ac11e",
              "name": "mapa_lon",
              "value": "=-46.685934",
              "type": "string"
            },
            {
              "id": "9ac31861-0994-4e6e-876c-da3c95e8479b",
              "name": "mapa_lat",
              "value": "={{ Number(-22.603348) }}",
              "type": "string"
            },
            {
              "id": "28d7aafd-9099-43a1-a53e-ffc3d7bd5743",
              "name": "mapa_lon",
              "value": "={{ Number(-46.685934) }}",
              "type": "string"
            },
            {
              "id": "e178a9f6-90cd-4d47-b9c8-9562ca3ef17c",
              "name": "mapa_rua",
              "value": "={{ $json.nome_rua }}",
              "type": "string"
            },
            {
              "id": "f49dcbc3-3a26-4b7e-bcc0-55fb25a182e7",
              "name": "mapa_municipio",
              "value": "={{ $json.municipio_uf }}",
              "type": "string"
            },
            {
              "id": "613a1372-0741-47e5-8554-6747d1674902",
              "name": "mapa_zoom",
              "value": "16",
              "type": "string"
            },
            {
              "id": "ec6a4b40-a35e-476c-941b-c4dc7324a2be",
              "name": "mapa_largura",
              "value": "1280",
              "type": "string"
            },
            {
              "id": "a6029ca2-10a4-4a3b-93ab-b13bbe64127c",
              "name": "mapa_altura",
              "value": "720",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "id": "7094305a-4405-4aa0-ab2f-feb0c8fe4e35",
      "name": "municipio_uf",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        -1728,
        272
      ],
      "executeOnce": false,
      "retryOnFail": false
    },
    {
      "parameters": {
        "url": "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "SingleLine",
              "value": "={{ $json.endereco_completo }}"
            },
            {
              "name": "f",
              "value": "json"
            },
            {
              "name": "maxLocations",
              "value": "1"
            },
            {
              "name": "outFields",
              "value": "*"
            }
          ]
        },
        "options": {}
      },
      "id": "dbe7c9c5-c464-4976-9bd4-48fde202b524",
      "name": "Geocodificação vista Aérea",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1040,
        288
      ],
      "retryOnFail": true
    },
    {
      "parameters": {
        "url": "https://maps.geoapify.com/v1/staticmap?style=osm-bright&center=lonlat:-46.685934,-22.603348&zoom=16&width=1280&height=720&format=png&apiKey=3c2e394a6cac455089d092f743ca4343",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "mapa_base"
            }
          }
        }
      },
      "id": "799da3d4-e5d6-4d3e-aca3-c40815c0b13c",
      "name": "mapa_base",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1216,
        368
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://infosiga.detran.sp.gov.br/infomapa",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "URL",
              "value": "=https://infosiga.detran.sp.gov.br/infomapa"
            }
          ]
        },
        "sendBody": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "SERVICE",
              "value": "={{'wms'}}"
            },
            {
              "name": "VERSION",
              "value": "={{'1.1.1'}}"
            },
            {
              "name": "REQUEST",
              "value": "={{'GetMap'}}"
            },
            {
              "name": "FORMAT",
              "value": "={{'image/png'}}"
            },
            {
              "name": "TRANSPARENT",
              "value": "={{'true'}}"
            },
            {
              "name": "LAYERS",
              "value": "={{'infosiga:acidentes'}}"
            },
            {
              "name": "STYLES",
              "value": "={{ 'heatmap_a_v' }}"
            },
            {
              "name": "SRS",
              "value": "={{'EPSG:4326'}}"
            },
            {
              "name": "WIDTH",
              "value": "={{'1280'}}"
            },
            {
              "name": "HEIGHT",
              "value": "={{'720'}}"
            },
            {
              "name": "ENV",
              "value": "={{'radius:50'}}"
            },
            {
              "name": "TIME",
              "value": "={{'0/9999'}}"
            },
            {
              "name": "BBOX",
              "value": "={{' -46.84288999260371,-22.696868630250687,-46.65735883184616,-22.483959244828757'}}"
            },
            {
              "name": "CQL_FILTER",
              "value": "={{' 1=1'}}"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "=mapa_calor_imagem "
            }
          },
          "timeout": 60000
        }
      },
      "id": "96d7d2f5-5dc5-4589-ba9f-063ea67be81c",
      "name": "mapa_calor1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1328,
        448
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "operation": "transparent",
        "dataPropertyName": "=mapa_calor_imagem ",
        "color": "#FFFFFF",
        "options": {}
      },
      "id": "c40a7ac3-d501-415a-8de2-1169e64a1dff",
      "name": "Edit Image",
      "type": "n8n-nodes-base.editImage",
      "typeVersion": 1,
      "position": [
        -1024,
        480
      ]
    },
    {
      "parameters": {
        "url": "={{ 'https://maps.geoapify.com/v1/staticmap?style=osm-bright&width=800&height=500&center=lonlat:'\n+ String($json.mapa_lon).replace(',', '.')\n+ ','\n+ String($json.mapa_lat).replace(',', '.')\n+ '&zoom=16&marker=lonlat:'\n+ String($json.mapa_lon).replace(',', '.')\n+ ','\n+ String($json.mapa_lat).replace(',', '.')\n+ ';color:%23ff0000;size:medium&format=png&apiKey=3c2e394a6cac455089d092f743ca4343'\n}}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "mapa"
            }
          },
          "timeout": 60000
        }
      },
      "id": "4829c340-4d0a-475d-9931-b9af3da45c90",
      "name": "mapa",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1280,
        240
      ],
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "actorId": {
          "__rl": true,
          "value": "tnudF2IxzORPhg4r8",
          "mode": "list",
          "cachedResultName": "Google Images Scraper (hooli/google-images-scraper)",
          "cachedResultUrl": "https://console.apify.com/actors/tnudF2IxzORPhg4r8/input"
        },
        "customBody": "="
      },
      "id": "dd5bc9bc-5202-41b3-8c7b-3bf5914e25bd",
      "name": "imagem brasão",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        -1488,
        592
      ],
      "retryOnFail": true,
      "credentials": {
        "apifyApi": {
          "id": "HJgDNyXWUCGcvvvk",
          "name": "Apify account 2"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ee12aef6-77ab-4b6c-8870-da95a035f222",
              "name": "brasao",
              "value": "=https://images.apifyusercontent.com/QnY1CTI3rP82jXMZ-QuNQlTgSIzfu5xvbGfP-tuGFJU/cb:1/aHR0cHM6Ly9zZXJyYW5lZ3JhLnNwLmdvdi5ici9BcnF1aXRldHVyYS9JbWFnZW5zL2ZvdG9uYW9kaXNwb25pdmVsLmpwZw.jpg",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "d65fc7b5-8b67-45dc-9d33-92e23f7736f1",
      "name": "Edit Fields3",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        -1344,
        592
      ]
    },
    {
      "parameters": {
        "url": "https://upload.wikimedia.org/wikipedia/commons/2/2c/Brasao_Serra_Negra.png?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "=brasao_municipio"
            }
          }
        }
      },
      "id": "f194d357-bda6-41c2-ba83-b4828a87143b",
      "name": "brasao_municipio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1168,
        592
      ],
      "retryOnFail": true
    },
    {
      "parameters": {
        "operation": "Run actor and get dataset",
        "actorId": {
          "__rl": true,
          "value": "tnudF2IxzORPhg4r8",
          "mode": "list",
          "cachedResultName": "Google Images Scraper (hooli/google-images-scraper)",
          "cachedResultUrl": "https://console.apify.com/actors/tnudF2IxzORPhg4r8/input"
        },
        "customBody": "={{\n{\n  \"queries\": [\n    \"radar fixo eletrônico velocidade\"\n  ],\n  \"maxImages\": 2\n}\n}}"
      },
      "id": "c5ccd35e-30cb-4cf6-82fc-d1e062aefed0",
      "name": "imagem dos equipamento",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        -1616,
        768
      ],
      "retryOnFail": true,
      "credentials": {
        "apifyApi": {
          "id": "HJgDNyXWUCGcvvvk",
          "name": "Apify account 2"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b9ce839e-29fa-4dd2-8065-7611efcc9dd7",
              "name": "equipamento_img_url",
              "value": "={{ $json.imageUrl }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "include": "selected",
        "includeFields": "=equipamento_img_url",
        "options": {}
      },
      "id": "db5ddd5a-540d-4559-8412-d075be6efcda",
      "name": "Edit Fields4",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        -1424,
        768
      ],
      "retryOnFail": true
    },
    {
      "parameters": {},
      "id": "5dece2c2-5e22-4f2a-ba75-e387113e8b0b",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        -1248,
        768
      ]
    },
    {
      "parameters": {
        "url": "={{ $json.equipamento_img_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "=equipamento_img_1"
            }
          }
        }
      },
      "id": "9dac32cf-631d-46fc-8ec6-d6bb5e249d3a",
      "name": "imagem equipamentos",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1040,
        768
      ],
      "retryOnFail": true
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "9add0ec7-6b59-424d-80b5-34148000d3c8",
              "name": "codigo_endereco",
              "value": "={{ $json.codigo_endereco }}",
              "type": "string"
            },
            {
              "id": "89c0b1d4-a7a6-4624-90fa-e814a1e0c064",
              "name": "=nome_rua",
              "value": "={{ $json.nome_rua }}",
              "type": "string"
            },
            {
              "id": "1274a076-c605-4b7c-9e87-21443e9715de",
              "name": "codigo_municipio",
              "value": "={{ $json.codigo_municipio }}",
              "type": "string"
            },
            {
              "id": "c0afbb9f-df27-4ca5-a0f8-11029355d233",
              "name": "nome_orgao",
              "value": "={{ $json.nome_orgao }}",
              "type": "string"
            },
            {
              "id": "d67c8ba6-ce75-4c4b-b19f-61d65e47ea65",
              "name": "municipio_uf",
              "value": "={{ $json.municipio_uf }}",
              "type": "string"
            },
            {
              "id": "74fe7b57-5b30-4363-b26b-3eff8d51250a",
              "name": "endereco",
              "value": "={{ $json.endereco }}",
              "type": "string"
            },
            {
              "id": "2b9d1038-a425-4758-aaf3-242508392a33",
              "name": "numero",
              "value": "={{ $json.numero }}",
              "type": "string"
            },
            {
              "id": "b5b7f5b6-2da4-406e-82d1-1c16dd32b3f5",
              "name": "nome_equipamento",
              "value": "={{ $json.nome_equipamento }}",
              "type": "string"
            },
            {
              "id": "10b1892f-9fd8-4ff4-8005-36d94bcf6316",
              "name": "tipo_equipamento",
              "value": "={{ $json.tipo_equipamento }}",
              "type": "string"
            },
            {
              "id": "1e871fed-e772-408f-b68e-c75ab9d05328",
              "name": "codigo_equipamento",
              "value": "={{ $json.codigo_equipamento }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": "={{ true }}",
        "options": {}
      },
      "id": "f9d98056-7cee-4744-9b72-b687932c6271",
      "name": "Historico",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        -2192,
        384
      ],
      "retryOnFail": true
    },
    {
      "parameters": {
        "operation": "Run actor and get dataset",
        "actorId": {
          "__rl": true,
          "value": "seWbEZ2kjgNods5Ez",
          "mode": "list",
          "cachedResultName": "📍📸 Google Street View Scraper (PPE) (3x1t/google-street-view-scraper-ppe)",
          "cachedResultUrl": "https://console.apify.com/actors/seWbEZ2kjgNods5Ez/input"
        },
        "customBody": "={\n  \"latLonCoordinatesWithRadius\": [\n    {\n      \"latitude\": -22.6105296,\n      \"longitude\": -46.6999149,\n      \"radiusMeters\": 50\n    }\n  ],\n  \"scrapePanoramaImages\": true,\n  \"panoramaImageResolution\": \"4096x2048\",\n  \"resultLimitPerThread\": 1\n}"
      },
      "id": "ba5cf41c-7e8f-4aa5-9de8-a9112ce0a3d9",
      "name": "Apify account 2",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        -1600,
        64
      ],
      "retryOnFail": true,
      "credentials": {
        "apifyApi": {
          "id": "HJgDNyXWUCGcvvvk",
          "name": "Apify account 2"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d6eb552f-4266-4e0c-9a7f-991b6a20135c",
              "name": "panorama_url",
              "value": "={{ $json.panoramaImageUrl }}",
              "type": "string"
            },
            {
              "id": "88de7b59-0e79-4578-82ba-99440b97f348",
              "name": "heading_indo",
              "value": 0,
              "type": "number"
            },
            {
              "id": "7fc3695a-daa6-44f0-81a4-ed4987413c25",
              "name": "heading_vindo",
              "value": 180,
              "type": "number"
            },
            {
              "id": "3776e800-8455-4165-a5e7-13b54d0570d0",
              "name": "fov",
              "value": "={{ 100}}",
              "type": "number"
            },
            {
              "id": "383f83dd-edff-4462-a90b-7dab965b7775",
              "name": "largura",
              "value": "1280",
              "type": "string"
            },
            {
              "id": "a089715d-734e-4060-951f-d9460a428136",
              "name": "altura",
              "value": "720",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "7371edf4-ff8f-42f6-b422-f1ed928a676e",
      "name": "Edit Fields5",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        -1440,
        80
      ]
    },
    {
      "parameters": {
        "amount": 60
      },
      "id": "9d34f4a9-f36e-4456-a215-0f4bbceca47a",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1264,
        112
      ],
      "webhookId": "f2559b90-48e7-4ae6-8379-315045754d30"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://panorama-converter-java.onrender.com/api/panorama/convert",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "panorama_url",
              "value": "={{ $json.panorama_url }}"
            },
            {
              "name": "heading",
              "value": "={{ Number($json[\"cabeçalho_indo\"] ?? 0) }}"
            },
            {
              "name": "fov",
              "value": "={{ Number($json[\"campo de visão\"] ?? 100) }}"
            },
            {
              "name": "largura",
              "value": "={{ Number($json.largura ?? 1280) }}"
            },
            {
              "name": "altura",
              "value": "={{ Number($json.altura ?? 720) }}"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "imagem_indo1"
            }
          },
          "timeout": 60000
        }
      },
      "id": "cb748033-98b3-45d2-9cb9-259ab4954b4f",
      "name": "imagem_indo1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1040,
        144
      ],
      "retryOnFail": true
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "numberInputs": 7,
        "options": {
          "includeUnpaired": true
        }
      },
      "id": "4e4cd149-a894-4698-91f7-3d1d54d3be2c",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        -400,
        160
      ]
    },
    {
      "parameters": {
        "jsCode": "const item = $input.first();\n\nreturn [\n  {\n    json: item.json,\n    binary: {\n      mapa_calor_final: item.binary.mapa_calor_final\n    }\n  }\n];"
      },
      "id": "5d623a51-a848-45a2-9bc4-406deae2261f",
      "name": "Code in JavaScript1",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -480,
        464
      ]
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {
          "clashHandling": {
            "values": {
              "resolveClash": "preferInput1"
            }
          }
        }
      },
      "id": "1407cacb-8053-412d-b35a-11218f3dd66a",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        -880,
        400
      ]
    },
    {
      "parameters": {
        "jsCode": "const item = $input.first();\n\nreturn [\n  {\n    json: {\n      ...item.json,\n      campos_binarios: Object.keys(item.binary ?? {})\n    },\n    binary: item.binary\n  }\n];\n"
      },
      "id": "a57b8bfb-7fa7-445d-99e4-1afdf840c31a",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -736,
        416
      ]
    },
    {
      "parameters": {
        "operation": "composite",
        "dataPropertyName": "={{ $json.campos_binarios[0] }}",
        "dataPropertyNameComposite": "={{ $json.campos_binarios[1] }}",
        "options": {
          "destinationKey": "mapa_calor_final"
        }
      },
      "id": "a1acecbd-294b-45c9-944e-ea316510ec6b",
      "name": "mapa_calor",
      "type": "n8n-nodes-base.editImage",
      "typeVersion": 1,
      "position": [
        -608,
        432
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://panorama-converter-java.onrender.com",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1760,
        96
      ],
      "id": "d7b4a75b-af03-4370-8bc1-cb4f66b0f3d2",
      "name": "Acordar Render",
      "retryOnFail": true,
      "maxTries": 4,
      "waitBetweenTries": 3000
    },
    {
      "parameters": {
        "operation": "upsert",
        "dataTableId": {
          "__rl": true,
          "value": "o9oswLD8NYIleiUf",
          "mode": "list",
          "cachedResultName": "PLANILHA",
          "cachedResultUrl": "/projects/c8ymKXGtiELTVSRg/datatables/o9oswLD8NYIleiUf"
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyValue": "={{ $json.codigo_endereco }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "PLANILHA": "={{ JSON.stringify($json) }}"
          },
          "matchingColumns": [
            "PLANILHA"
          ],
          "schema": [
            {
              "id": "PLANILHA",
              "displayName": "PLANILHA",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        -2192,
        528
      ],
      "id": "785eadaa-a398-41d0-94b1-ce5ecbadc0ac",
      "name": "Upsert row(s)"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://panorama-converter-java.onrender.com/api/panorama/convert",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "heading",
              "value": "={{ (Number($json[\"cabeçalho_vindo\"] ?? 180) + 360) % 360 }}"
            },
            {
              "name": "fov",
              "value": "={{ Number($json[\"campo de visão\"] ?? 100) }}"
            },
            {
              "name": "largura",
              "value": "={{ Number($json.largura ?? 1280) }}"
            },
            {
              "name": "altura",
              "value": "={{ Number($json.altura ?? 720) }}"
            },
            {
              "name": "panorama_url",
              "value": "={{ $json.panorama_url }}"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "imagem_vindo1"
            }
          },
          "timeout": 120000
        }
      },
      "id": "2cc09182-17e8-421c-956d-ad26bd0d2386",
      "name": "imagem_vindo1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        -1040,
        0
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 1000
    },
    {
      "parameters": {
        "resource": "documentGeneration",
        "templateBinaryProperty": "=data",
        "templateType": "docx",
        "data": "={{ JSON.stringify({\n  dados: [{\n    codigo_endereco: 92,\n    nome_orgao: \"Prefeitura Municipal de Serra Negra\",\n    municipio_uf: \"Serra Negra - SP\",\n    endereco: \"Praça John F. Kennedy\",\n    numero: \"SN\",\n    nome_rua: \"Rua João Gerosa\",\n    equipamento: \"Controlador Eletrônico de Velocidade Fixo\",\n    tipo: \"Radar Fixo\",\n    latitude: -22.603348,\n    longitude: -46.685934\n  }]\n}) }}",
        "outputType": "=docx",
        "outputBinaryProperty": "=data"
      },
      "type": "n8n-nodes-cloudofficeprint.cloudOfficePrint",
      "typeVersion": 1,
      "position": [
        -2176,
        864
      ],
      "id": "f56e03fe-b345-4102-a8c6-5a06060f870b",
      "name": "Generate a document from a template",
      "credentials": {
        "copApi": {
          "id": "iAV5BArVGzgbbuvr",
          "name": "Cloud Office Print account"
        }
      }
    },
    {
      "parameters": {
        "fileSelector": "/home/node/.n8n-files/modelo.docx",
        "options": {
          "dataPropertyName": "data"
        }
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1.1,
      "position": [
        -2192,
        672
      ],
      "id": "110d9da5-b976-45cf-a650-c63ff7a0a5b5",
      "name": "/home/node/.n8n-files/modelo.docx",
      "executeOnce": false,
      "retryOnFail": true
    }
  ],
  "pinData": {
    "Webhook": [
      {
        "json": {
          "codigo_endereco": 92,
          "codigo_municipio": 10,
          "codigo_equipamento": 1,
          "nome_orgao": "Prefeitura Municipal de Serra Negra",
          "municipio_uf": "Serra Negra - SP",
          "endereco": "Praça John F. Kennedy",
          "nome_rua": "Praça John F. Kennedy",
          "numero": "SN",
          "nome_equipamento": "Controlador Eletrônico de Velocidade Fixo",
          "tipo_equipamento": "Radar Fixo"
        }
      }
    ]
  },
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "municipio_uf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "municipio_uf": {
      "main": [
        [
          {
            "node": "Geocodificação vista Aérea",
            "type": "main",
            "index": 0
          },
          {
            "node": "mapa_base",
            "type": "main",
            "index": 0
          },
          {
            "node": "mapa",
            "type": "main",
            "index": 0
          },
          {
            "node": "imagem brasão",
            "type": "main",
            "index": 0
          },
          {
            "node": "imagem dos equipamento",
            "type": "main",
            "index": 0
          },
          {
            "node": "Acordar Render",
            "type": "main",
            "index": 0
          },
          {
            "node": "mapa_calor1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Geocodificação vista Aérea": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "mapa_base": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "mapa_calor1": {
      "main": [
        [
          {
            "node": "Edit Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "mapa": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "imagem brasão": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields3": {
      "main": [
        [
          {
            "node": "brasao_municipio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "brasao_municipio": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "imagem dos equipamento": {
      "main": [
        [
          {
            "node": "Edit Fields4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields4": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "imagem equipamentos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "imagem equipamentos": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 6
          }
        ]
      ]
    },
    "Historico": {
      "main": [
        [
          {
            "node": "Upsert row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apify account 2": {
      "main": [
        [
          {
            "node": "Edit Fields5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields5": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "imagem_indo1",
            "type": "main",
            "index": 0
          },
          {
            "node": "imagem_vindo1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "imagem_indo1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 5
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "mapa_calor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "mapa_calor": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Acordar Render": {
      "main": [
        [
          {
            "node": "Apify account 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert row(s)": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "imagem_vindo1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Generate a document from a template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "timeSavedMode": "fixed",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "versionId": "7b97afb7-c988-4cce-a432-6d07d48b6a08",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "1141d4330cefbbc7491ea53a15438c9d53a972b4d5d240532ab490e50bb58b5e"
  },
  "nodeGroups": [],
  "id": "GSKrkmPgxRpPgxCV",
  "tags": []
}