{
  "format": "chatigram-workflow",
  "version": 1,
  "metadata": {
    "sourceName": "Capture a lead in your CRM",
    "importHelp": {
      "note": "Setup required. Set a fresh trigger secret and your CRM API URL and authorization. Use the payload format required by that CRM. Placeholder endpoints use example.invalid and cannot call a real business service. Keep the workflow disabled until you finish the setup and review its effects."
    }
  },
  "workflow": {
    "instruction": null,
    "multiLanguageSupport": null,
    "properties": [],
    "trigger": {
      "$tag": "Trigger",
      "type": "HTTP_ENDPOINT",
      "data": {
        "secretKey": "",
        "authEnabled": true,
        "extractors": [
          {
            "$tag": "GetWholeAsString",
            "variableName": "payload"
          }
        ]
      }
    },
    "nodes": [
      {
        "$tag": "Node",
        "id": "d0c00000-0000-4000-8000-000000000001",
        "name": "createLead",
        "parentId": null,
        "branchIndex": 0,
        "type": "HTTP_REQUEST_NODE_TYPE",
        "data": {
          "request": {
            "method": "POST",
            "path": [
              {
                "$tag": "Constant",
                "value": "https://business-api.example.invalid/crm/leads"
              }
            ],
            "headers": [
              {
                "key": "Content-Type",
                "value": [
                  {
                    "$tag": "Constant",
                    "value": "application/json"
                  }
                ]
              }
            ],
            "queryStrings": [],
            "body": [
              {
                "$tag": "Variable",
                "name": "trigger.payload"
              }
            ]
          },
          "responseHandlers": [
            {
              "$tag": "GetWholeAsString",
              "variableName": "response"
            }
          ]
        }
      },
      {
        "$tag": "Node",
        "id": "d0c00000-0000-4000-8000-000000000002",
        "name": "accepted",
        "parentId": "d0c00000-0000-4000-8000-000000000001",
        "branchIndex": 0,
        "type": "HTTP_RESPONSE",
        "data": {
          "statusCode": 202,
          "headers": [],
          "body": {
            "$tag": "Json",
            "value": {
              "$tag": "Object",
              "properties": [
                {
                  "key": "status",
                  "value": {
                    "$tag": "String",
                    "value": [
                      {
                        "$tag": "Constant",
                        "value": "accepted"
                      }
                    ]
                  }
                }
              ]
            }
          }
        }
      },
      {
        "$tag": "Node",
        "id": "d0c00000-0000-4000-8000-000000000003",
        "name": "failed",
        "parentId": "d0c00000-0000-4000-8000-000000000001",
        "branchIndex": 1,
        "type": "HTTP_RESPONSE",
        "data": {
          "statusCode": 502,
          "headers": [],
          "body": {
            "$tag": "Json",
            "value": {
              "$tag": "Object",
              "properties": [
                {
                  "key": "status",
                  "value": {
                    "$tag": "String",
                    "value": [
                      {
                        "$tag": "Constant",
                        "value": "not_completed"
                      }
                    ]
                  }
                }
              ]
            }
          }
        }
      }
    ],
    "gotos": []
  }
}
