{
  "name": "Lancer: new lead → Google Sheets",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": { "hook": null, "maxResults": 1 },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "restore": {},
        "expect": [],
        "interface": [
          { "name": "id", "type": "text" },
          { "name": "event", "type": "text" },
          { "name": "createdAt", "type": "text" },
          {
            "name": "data",
            "type": "collection",
            "spec": [
              { "name": "id", "type": "text" },
              { "name": "name", "type": "text" },
              { "name": "company", "type": "text" },
              { "name": "phone", "type": "text" },
              { "name": "email", "type": "text" },
              { "name": "source", "type": "text" },
              { "name": "expectedValueAgorot", "type": "number" }
            ]
          }
        ]
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFilter",
      "version": 1,
      "parameters": {},
      "mapper": {},
      "filter": {
        "name": "Only lead.created",
        "conditions": [[{ "a": "{{1.event}}", "b": "lead.created", "o": "text:equal" }]]
      },
      "metadata": { "designer": { "x": 300, "y": 0 } }
    },
    {
      "id": 3,
      "module": "google-sheets:addRow",
      "version": 2,
      "parameters": { "__IMTCONN__": null },
      "mapper": {
        "mode": "select",
        "insertUnformatted": false,
        "valueInputOption": "USER_ENTERED",
        "insertDataOption": "INSERT_ROWS",
        "values": {
          "0": "{{1.createdAt}}",
          "1": "{{1.data.name}}",
          "2": "{{1.data.company}}",
          "3": "{{1.data.phone}}",
          "4": "{{1.data.email}}",
          "5": "{{1.data.source}}",
          "6": "{{ifempty(1.data.expectedValueAgorot / 100; \"\")}}",
          "7": "{{1.data.id}}"
        }
      },
      "metadata": { "designer": { "x": 600, "y": 0 } }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": { "roundtrips": 1, "maxErrors": 3, "autoCommit": true, "autoCommitTriggerLast": true, "sequential": false, "confidential": false, "dataloss": false, "dlq": false },
    "designer": { "orphans": [] }
  }
}
