{
  "name": "File Conversion via Convertfleet \u2014 No ffmpeg Lambda Layer",
  "nodes": [
    {
      "parameters": {
        "content": "## Setup\n1. Copy your Convertfleet API key from https://convertfleet.com/dashboard and paste it into **Set Config** \u2192 `apiKey`.\n2. Activate this webhook and grab the Production URL.\n3. POST to the webhook with JSON body:\n   `{ \"file_url\": \"https://\u2026/doc.docx\", \"target_format\": \"pdf\", \"output_filename\": \"result\" }`\n4. Works with any S3 pre-signed URL, Supabase Storage URL, or public HTTPS link.\n5. Supported formats: PDF, DOCX, XLSX, PPTX, PNG, JPG, WebP, MP4, MP3, WAV, and more \u2014 no ffmpeg layer needed.",
        "height": 280,
        "width": 440,
        "color": 5
      },
      "id": "a1b2c3d4-0001-0001-0001-000000000001",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        200,
        560
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "convert-file",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "a1b2c3d4-0002-0002-0002-000000000002",
      "name": "Incoming File Request",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        200,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "cfg1",
              "name": "apiKey",
              "value": "YOUR_API_KEY",
              "type": "string"
            },
            {
              "id": "cfg2",
              "name": "apiBase",
              "value": "https://api.convertfleet.com/v1",
              "type": "string"
            },
            {
              "id": "cfg3",
              "name": "fileUrl",
              "value": "={{ $json.body.file_url }}",
              "type": "string"
            },
            {
              "id": "cfg4",
              "name": "targetFormat",
              "value": "={{ $json.body.target_format }}",
              "type": "string"
            },
            {
              "id": "cfg5",
              "name": "outputFilename",
              "value": "={{ $json.body.output_filename ?? 'converted' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-0003-0003-0003-000000000003",
      "name": "Set Config",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $json.apiBase }}/convert",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $json.apiKey }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "keypair",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file_url",
              "value": "={{ $json.fileUrl }}"
            },
            {
              "name": "target_format",
              "value": "={{ $json.targetFormat }}"
            },
            {
              "name": "output_filename",
              "value": "={{ $json.outputFilename }}"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "fullResponse": false
            }
          }
        }
      },
      "id": "a1b2c3d4-0004-0004-0004-000000000004",
      "name": "Convert via Convertfleet",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "cond1",
              "leftValue": "={{ $json.status }}",
              "rightValue": "success",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "a1b2c3d4-0005-0005-0005-000000000005",
      "name": "Conversion OK?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        980,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ success: true, output_url: $json.output_url, target_format: $json.target_format, file_size_bytes: $json.file_size_bytes, message: 'Converted via Convertfleet \u2014 no Lambda layer required' }) }}",
        "options": {
          "responseCode": 200
        }
      },
      "id": "a1b2c3d4-0006-0006-0006-000000000006",
      "name": "Return Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1220,
        160
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ success: false, error: $json.error ?? $json.message ?? 'Conversion failed', status: $json.status }) }}",
        "options": {
          "responseCode": 422
        }
      },
      "id": "a1b2c3d4-0007-0007-0007-000000000007",
      "name": "Return Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1220,
        440
      ]
    }
  ],
  "connections": {
    "Incoming File Request": {
      "main": [
        [
          {
            "node": "Set Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Config": {
      "main": [
        [
          {
            "node": "Convert via Convertfleet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert via Convertfleet": {
      "main": [
        [
          {
            "node": "Conversion OK?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conversion OK?": {
      "main": [
        [
          {
            "node": "Return Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Return Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}