How it Works:
action
query parameter received from the webhook. This determines which part of the book creation process will be executed.recordId
.Set Up Steps:
Airtable Setup (Estimated time: 10-15 minutes):
Trigger: When a record matches conditions -> Action
is Generate Book Details
Action: Run a script. Use the following script:
let autoRoute = input.config();
await fetch(autoRoute.webhookUrl + "?recordId=" + autoRoute.recordId + "&action=" + autoRoute.action);
In the script action's configuration, add three "Input variables":
* `webhookUrl` (map it to your n8n webhook URL, obtained in the next step)
* `recordId` (map it to the Airtable record ID)
* `action` (map it to `Action`)
Repeat this process to create two more automations in the "Book" table, identical except triggered when Action
is Generate Chapters
, respectively.
Action
is Generate Chapter Research
Action
is Generate Chapter Content
.n8n Setup (Estimated time: 15-20 minutes):
webhookUrl
you'll use in the Airtable automations. Important: Once you've tested and are ready to go live, switch to the "Production URL."Testing (Estimated Time: 5-10 minutes):
Generate Chapters
, Generate Chapter Research
and Generate Chapter Content
.