{
  "name": "Orchard — YouTube to Notion",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "orchard-youtube",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "trigger",
      "name": "Webhook · trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [240, 300],
      "webhookId": "orchard-youtube"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.orchardrun.com/v1/transcriptions",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer ork_REPLACE_ME" },
            { "name": "Content-Type", "value": "application/json" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"url\": \"{{$json.youtube_url}}\",\n  \"language\": \"{{$json.language || 'en'}}\",\n  \"webhook_url\": \"{{$execution.resumeUrl}}\"\n}",
        "options": {}
      },
      "id": "dispatch",
      "name": "Orchard · POST /v1/transcriptions",
      "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": [680, 300],
      "webhookId": "wait-orchard"
    },
    {
      "parameters": {
        "resource": "databasePage",
        "databaseId": "REPLACE_NOTION_DB_ID",
        "title": "={{$json.body.result.text.substring(0, 80)}}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Transcript",
              "type": "rich_text",
              "richText": "={{$json.body.result.text}}"
            },
            {
              "key": "Language",
              "type": "rich_text",
              "richText": "={{$json.body.result.language}}"
            }
          ]
        },
        "options": {}
      },
      "id": "notion",
      "name": "Notion · save",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [900, 300]
    }
  ],
  "connections": {
    "Webhook · trigger": {
      "main": [[{ "node": "Orchard · POST /v1/transcriptions", "type": "main", "index": 0 }]]
    },
    "Orchard · POST /v1/transcriptions": {
      "main": [[{ "node": "Wait for Orchard webhook", "type": "main", "index": 0 }]]
    },
    "Wait for Orchard webhook": {
      "main": [[{ "node": "Notion · save", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "version": 1,
  "meta": {
    "instanceId": "orchard-template",
    "templateId": "orchard-youtube-to-notion"
  }
}
