Updated November 16, 2026 · By TypeFlow
Generate PDFs from an Airtable Automation Script
Add a "Run script" action to an Airtable automation, paste the script from your TypeFlow flow, and set the input variable record_id to the record ID: the automation then generates the document on its own.
Overview
For most automatic setups, TypeFlow Automation is simpler: no script, and conditions are built in. Use an Airtable automation script when document generation has to be one step of a longer Airtable automation, for example after other actions have updated the record.
How to Set Up
-
Open your flow in TypeFlow and go to the Actions tab
-
Choose Automatic Generation, then Airtable Automation, and copy the script
-
In Airtable, open Automations and create a new automation
-
Choose a trigger, for example "When record matches conditions" or "When record is created"
-
Add the action Run script (Airtable docs)
-
In the script settings, add an input variable named
record_idand set it to the Airtable record ID of the triggering record -
Paste the script, test it with a sample record, then turn the automation on
The script looks like this (TypeFlow fills in your table and flow IDs):
const recordId = input.config().record_id;
const res = await fetch(`https://app.typeflow.us/api/generate-doc?record_id=${recordId}&table_id=tblXXXXXXXX&flow_id=xxxxxxxx`);
Always copy it from your own flow: HTML templates and PDF forms use a different address.
Related
- TypeFlow Automation - Generate automatically without a script.
- Generate a PDF from a Button - One click per record, the best way to test.