{
  "name": "Orchard — Audio upload to Airtable",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "orchard-upload",
        "responseMode": "lastNode",
        "options": { "binaryData": true }
      },
      "id": "trigger",
      "name": "Webhook · file in",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [220, 300],
      "webhookId": "orchard-upload"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.orchardrun.com/v1/transcriptions/upload",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer ork_REPLACE_ME" }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            { "name": "file", "parameterType": "formBinaryData", "inputDataFieldName": "data" },
            { "name": "language", "value": "es" },
            { "name": "preprocess", "value": "fast" },
            { "name": "webhook_url", "value": "={{$execution.resumeUrl}}" }
          ]
        },
        "options": {}
      },
      "id": "dispatch",
      "name": "Orchard · POST /v1/transcriptions/upload",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [460, 300]
    },
    {
      "parameters": {
        "resume": "webhook",
        "options": {}
      },
      "id": "wait",
      "name": "Wait for Orchard webhook",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [700, 300],
      "webhookId": "wait-orchard-upload"
    },
    {
      "parameters": {
        "resource": "record",
        "operation": "create",
        "base": "REPLACE_AIRTABLE_BASE_ID",
        "table": "Transcripts",
        "fields": {
          "Text": "={{$json.body.result.text}}",
          "Language": "={{$json.body.result.language}}",
          "Duration (s)": "={{$json.body.result.duration_seconds}}",
          "Provider": "={{$json.body.result.provider}}"
        }
      },
      "id": "airtable",
      "name": "Airtable · save",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [940, 300]
    }
  ],
  "connections": {
    "Webhook · file in": {
      "main": [[{ "node": "Orchard · POST /v1/transcriptions/upload", "type": "main", "index": 0 }]]
    },
    "Orchard · POST /v1/transcriptions/upload": {
      "main": [[{ "node": "Wait for Orchard webhook", "type": "main", "index": 0 }]]
    },
    "Wait for Orchard webhook": {
      "main": [[{ "node": "Airtable · save", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "version": 1,
  "meta": {
    "instanceId": "orchard-template",
    "templateId": "orchard-upload-to-airtable"
  }
}
