{
  "format": "columba-flow",
  "formatVersion": 1,
  "app": "Columba · Blog",
  "flow": {
    "name": "Stripe · Pagamento confirmado",
    "description": "Dispara quando o Stripe avisa que uma cobrança criada pelo Columba foi paga (link de pagamento ou fatura, de um fluxo ou do botão Cobrar). Agradece na conversa, aplica a tag \"cliente-pagou\", move o negócio e avisa a equipe. \"Com fluxo em andamento\" = Ignorar, para não interromper um fluxo de cobrança que esteja esperando para conferir o status. Conversa em atendimento humano não é interrompida.",
    "triggerType": "trigger_stripe_event",
    "triggerConfig": {
      "nodeType": "trigger_stripe_event",
      "label": "Pagamento confirmado no Stripe",
      "events": ["payment_succeeded"],
      "kind": "any",
      "onlyFromColumba": true,
      "channel": "whatsapp",
      "onActiveFlow": "skip",
      "createContact": true
    },
    "priority": 10,
    "nodes": [
      {
        "id": "gatilho",
        "type": "trigger_stripe_event",
        "position": { "x": 0, "y": 0 },
        "data": {
          "nodeType": "trigger_stripe_event",
          "label": "Pagamento confirmado no Stripe",
          "events": ["payment_succeeded"],
          "kind": "any",
          "onlyFromColumba": true,
          "channel": "whatsapp",
          "onActiveFlow": "skip",
          "createContact": true
        }
      },
      {
        "id": "nota",
        "type": "note_sticky",
        "position": { "x": 380, "y": -40 },
        "data": {
          "nodeType": "note_sticky",
          "label": "Antes de publicar",
          "text": "Antes de publicar:\n1. Crie a tag \"cliente-pagou\" em Configurações › Tags (ou troque pela sua).\n2. No Mover de Etapa, escolha o funil e a etapa (ex.: Ganho).\n3. Em Extensões › Stripe › Notificações, deixe \"Pagamento confirmado\" ligado.\nConversa com atendente no comando não recebe a mensagem: o fluxo não atropela o atendimento humano."
        }
      },
      {
        "id": "obrigado",
        "type": "action_send_text",
        "position": { "x": 0, "y": 160 },
        "data": {
          "nodeType": "action_send_text",
          "label": "Agradece",
          "message": "Recebemos o seu pagamento de {{stripe.object.amount_formatted}}! ✅\nObrigado, {{contact.first_name}}. Qualquer dúvida, é só chamar por aqui."
        }
      },
      {
        "id": "tag",
        "type": "integration_tag_contact",
        "position": { "x": 0, "y": 310 },
        "data": {
          "nodeType": "integration_tag_contact",
          "label": "Tag: cliente-pagou",
          "tagAction": "add",
          "tags": "cliente-pagou"
        }
      },
      {
        "id": "ganho",
        "type": "integration_move_stage",
        "position": { "x": 0, "y": 460 },
        "data": {
          "nodeType": "integration_move_stage",
          "label": "Negócio → Ganho (escolha a etapa)",
          "stageId": "",
          "pipelineId": ""
        }
      },
      {
        "id": "sino",
        "type": "integration_notify_team",
        "position": { "x": 0, "y": 610 },
        "data": {
          "nodeType": "integration_notify_team",
          "label": "Avisa a equipe",
          "notificationMessage": "Pagamento confirmado no Stripe: {{contact.name}} pagou {{stripe.object.amount_formatted}} ({{stripe.kind}}). Ver no Stripe: {{stripe.object.dashboard_url}}",
          "priority": "medium"
        }
      }
    ],
    "edges": [
      {
        "id": "e_gatilho_obrigado",
        "source": "gatilho",
        "target": "obrigado"
      },
      {
        "id": "e_obrigado_tag",
        "source": "obrigado",
        "target": "tag"
      },
      {
        "id": "e_tag_ganho",
        "source": "tag",
        "target": "ganho"
      },
      {
        "id": "e_ganho_sino",
        "source": "ganho",
        "target": "sino"
      }
    ]
  }
}
