{
  "kind": "open-flow-workflow",
  "version": 1,
  "name": "Slack: Mention or Direct Message",
  "content": {
    "modelVersion": 14,
    "document": {
      "bindings": {},
      "graph": {
        "nodes": {
          "mention": {
            "name": "Slack mention or direct message",
            "kind": "integration",
            "connectionId": "docs-example-slack",
            "config": {
              "sourceId": {
                "kind": "value",
                "value": "source_00000000000000000000000000000000"
              },
              "eventTypes": {
                "kind": "value",
                "value": [
                  "app_mention",
                  "message.im"
                ]
              }
            },
            "definition": {
              "configInputs": [
                {
                  "jsonSchema": {
                    "type": "string",
                    "pattern": "^source_[0-9a-f]{32}$",
                    "title": "Event source"
                  },
                  "nullable": false,
                  "handle": "sourceId"
                },
                {
                  "jsonSchema": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "app_mention",
                        "message.im"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "uniqueItems": true,
                    "title": "Events"
                  },
                  "nullable": false,
                  "handle": "eventTypes",
                  "value": [
                    "app_mention",
                    "message.im"
                  ]
                },
                {
                  "jsonSchema": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    },
                    "maxItems": 100,
                    "uniqueItems": true,
                    "title": "Channel IDs"
                  },
                  "nullable": true,
                  "handle": "channelIds"
                }
              ],
              "definitionVersion": 2,
              "description": "Receives user mentions and new direct messages through a shared Slack application event source. Slack Connect events are excluded.",
              "displayName": "Mention or Direct Message",
              "key": "slackbot.on_event",
              "name": "on_event",
              "outputs": [
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "event"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "deliveryId"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "appId"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "teamId"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "channel"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "user"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "text"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "ts"
                },
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": true,
                  "handle": "threadTs"
                },
                {
                  "jsonSchema": {
                    "type": "object"
                  },
                  "nullable": false,
                  "handle": "body"
                }
              ],
              "provider": "slackbot",
              "type": "integration",
              "endpoint": {
                "body": {
                  "allowArray": false,
                  "allowEmpty": false,
                  "formats": [
                    "json"
                  ]
                },
                "methods": [
                  "POST"
                ],
                "successStatus": 200
              }
            }
          },
          "process": {
            "inputs": {
              "text": {
                "kind": "sources",
                "sources": [
                  {
                    "kind": "node",
                    "nodeId": "mention",
                    "output": "text"
                  }
                ]
              }
            },
            "name": "Prepare a reply draft",
            "kind": "task",
            "task": {
              "inputs": [
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "text"
                }
              ],
              "outputs": [
                {
                  "jsonSchema": {
                    "type": "string"
                  },
                  "nullable": false,
                  "handle": "message"
                }
              ],
              "name": "Prepare a reply draft",
              "moduleId": "process-module",
              "capabilities": [
                {
                  "kind": "connector",
                  "mode": "independent",
                  "actions": []
                }
              ]
            }
          }
        },
        "edges": [
          {
            "source": "mention",
            "target": "process"
          }
        ]
      }
    },
    "modules": {
      "process-module": {
        "name": "Prepare a reply draft",
        "imports": [],
        "source": "export default ({ text }) => ({ message: \"Review this request: \" + text });"
      }
    }
  },
  "presentation": {
    "designer": {
      "version": 1,
      "flow": {
        "nodes": {
          "mention": {
            "x": 0,
            "y": 0
          },
          "process": {
            "x": 340,
            "y": 0
          }
        }
      }
    }
  }
}
