{
  "name": "ASHDOCS — Webhook in, compressed PDF URL out",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": { "maxResults": 1 },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "notes": "After import: create the webhook, then POST JSON like {\"file_url\": \"https://...\"} to it."
      }
    },
    {
      "id": 2,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": { "handleErrors": false, "useNewZLibDeCompress": true },
      "mapper": {
        "url": "https://www.ashdocs.com/api/v1/tools/compress",
        "method": "post",
        "headers": [
          { "name": "X-API-Key", "value": "YOUR_API_KEY" },
          { "name": "Content-Type", "value": "application/json" }
        ],
        "qs": [],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\"file_url\": \"{{1.file_url}}\", \"options\": {\"output\": \"url\"}}",
        "timeout": "300",
        "shareCookies": false,
        "ca": "",
        "rejectUnauthorized": true,
        "followRedirect": true,
        "useQuerystring": false,
        "gzip": true,
        "useMtls": false,
        "parseResponse": true,
        "authUser": "",
        "authPass": "",
        "followAllRedirects": false,
        "serializeUrl": false
      },
      "metadata": {
        "designer": { "x": 300, "y": 0 },
        "notes": "Replace YOUR_API_KEY. The incoming file_url must be publicly downloadable — the API fetches it server-side."
      }
    },
    {
      "id": 3,
      "module": "gateway:WebhookRespond",
      "version": 1,
      "parameters": {},
      "mapper": {
        "status": "200",
        "body": "{\"file_url\": \"{{2.data.file_url}}\", \"expires_at\": \"{{2.data.expires_at}}\"}",
        "headers": [
          { "key": "Content-Type", "value": "application/json" }
        ]
      },
      "metadata": {
        "designer": { "x": 600, "y": 0 },
        "notes": "Responds to the caller with the compressed file's signed URL (valid 60 minutes)."
      }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": { "orphans": [] }
  }
}
