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

  1. Open your flow in TypeFlow and go to the Actions tab

  2. Choose Automatic Generation, then Airtable Automation, and copy the script

  3. In Airtable, open Automations and create a new automation

  4. Choose a trigger, for example "When record matches conditions" or "When record is created"

  5. Add the action Run script (Airtable docs)

  6. In the script settings, add an input variable named record_id and set it to the Airtable record ID of the triggering record

  7. 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.



FAQ

Was this page helpful?