{
  "name": "ASHDOCS — Watch Drive folder, convert Office files to PDF",
  "flow": [
    {
      "id": 1,
      "module": "google-drive:watchFilesInAFolder",
      "version": 4,
      "parameters": { "limit": 1 },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "notes": "After import: connect Google Drive and choose the folder to watch."
      }
    },
    {
      "id": 2,
      "module": "google-drive:getAFile",
      "version": 4,
      "parameters": {},
      "mapper": { "file": "{{1.id}}" },
      "metadata": {
        "designer": { "x": 300, "y": 0 },
        "notes": "Downloads the new file's binary for the upload to ASHDOCS."
      }
    },
    {
      "id": 3,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": { "handleErrors": false, "useNewZLibDeCompress": true },
      "mapper": {
        "url": "https://www.ashdocs.com/api/v1/tools/office-to-pdf",
        "method": "post",
        "headers": [
          { "name": "X-API-Key", "value": "YOUR_API_KEY" }
        ],
        "qs": [],
        "bodyType": "multipart_form_data",
        "formDataFields": [
          { "key": "files", "type": "file", "data": "{{2.data}}", "fileName": "{{1.name}}" },
          { "key": "options", "type": "text", "value": "{\"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": 600, "y": 0 },
        "notes": "Replace YOUR_API_KEY. Content-Type stays unset — Make sets the multipart boundary itself."
      }
    },
    {
      "id": 4,
      "module": "http:ActionGetFile",
      "version": 1,
      "parameters": {},
      "mapper": { "url": "{{3.data.file_url}}" },
      "metadata": {
        "designer": { "x": 900, "y": 0 },
        "notes": "Turns the signed 60-minute URL into the actual PDF binary."
      }
    },
    {
      "id": 5,
      "module": "google-drive:uploadAFile",
      "version": 4,
      "parameters": {},
      "mapper": {
        "title": "{{1.name}}.pdf",
        "data": "{{4.data}}"
      },
      "metadata": {
        "designer": { "x": 1200, "y": 0 },
        "notes": "Reconnect Google Drive and pick the destination folder after import."
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": { "orphans": [] }
  }
}
