{
  "kind": "open-flow-workflow",
  "version": 1,
  "name": "Respond to a Webhook",
  "content": {
    "modelVersion": 14,
    "document": {
      "bindings": {},
      "graph": {
        "nodes": {
          "webhook": {
            "name": "Receive a ticket",
            "kind": "webhook",
            "bodyFields": [
              {
                "jsonSchema": {
                  "type": "string"
                },
                "nullable": false,
                "handle": "message"
              }
            ],
            "method": "POST",
            "options": {
              "responseBody": {
                "kind": "webhook-response",
                "nodeId": "respond",
                "timeoutMs": 30000
              }
            }
          },
          "prepare": {
            "inputs": {
              "message": {
                "kind": "sources",
                "sources": [
                  {
                    "kind": "node",
                    "nodeId": "webhook",
                    "output": "body",
                    "field": "message"
                  }
                ]
              }
            },
            "name": "Prepare acknowledgement",
            "kind": "task",
            "task": {
              "inputs": [
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "message"
                }
              ],
              "outputs": [
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "message"
                }
              ],
              "name": "Prepare acknowledgement",
              "moduleId": "prepare-module",
              "capabilities": [
                {
                  "kind": "connector",
                  "mode": "independent",
                  "actions": []
                }
              ]
            }
          },
          "respond": {
            "inputs": {
              "body": {
                "kind": "sources",
                "sources": [
                  {
                    "kind": "node",
                    "nodeId": "prepare",
                    "output": "message"
                  }
                ]
              },
              "statusCode": {
                "kind": "value",
                "value": 202
              },
              "headers": {
                "kind": "value",
                "value": {
                  "X-Workflow": "ticket-intake"
                }
              }
            },
            "name": "Acknowledge the request",
            "kind": "webhook-response"
          }
        },
        "edges": [
          {
            "source": "webhook",
            "target": "prepare"
          },
          {
            "source": "prepare",
            "target": "respond"
          }
        ]
      }
    },
    "modules": {
      "prepare-module": {
        "name": "Prepare acknowledgement",
        "imports": [],
        "source": "export default ({ message }) => ({ message: \"Received: \" + message });"
      }
    }
  },
  "presentation": {
    "designer": {
      "version": 1,
      "flow": {
        "nodes": {
          "webhook": {
            "x": 0,
            "y": 0
          },
          "prepare": {
            "x": 340,
            "y": 0
          },
          "respond": {
            "x": 680,
            "y": 0
          }
        }
      }
    }
  }
}
