Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Generating Docs and Updating Airtable | Building a Full n8n Workflow
AI Automation Workflows with n8n

bookGenerating Docs and Updating Airtable

To turn the AI output into a Google Doc, set up the workflow so it runs in a loop, processing multiple ASINs one by one. Each iteration creates or updates a document and then writes the status and document link back to Airtable. To make this work, add the following new nodes:

  • Google Docs: create a document;
  • Google Docs: update the document;
  • Split In Batches (or Loop Over Items) with batch size 1;
  • Airtable: Update the record with the final Complete status;
  • Set / Edit Fields to build a clickable Google Doc URL.

Creating and Updating the Google Doc

To generate a new Google Doc for each ASIN and fill it with the AI summary, add two Google Docs nodes in sequence.

  • Google Docs: create a document:

    • Drive: My Drive;
    • Folder: SaaS reports;
    • Title: summary and tips (temporary title).
  • Google Docs: Update a document:

    • Document ID/URL: drag from the Create a document output;
    • Text: drag the output of the AI Agent (the LLM's summary).

Execute the nodes, open Google Drive, and confirm that the created document contains the AI-generated text.

Note
Note

If the AI output isn't mapped into the Text field, Google Docs throws an insert text must be… error. Make sure the LLM result is mapped correctly, then re-run the node.

Batching and Looping the Workflow

To prevent multiple ASINs from running at once, batch the flow so it processes items one by one.

  • Airtable search records:

    • Limit: 10 (or the number you prefer);
    • This node stays outside the loop.
  • Split In Batches (or Loop Over Items):

    • Batch size: 1.

Connect the loop as follows:

Search Records β†’ Split In Batches β†’ (rest of the workflow) β†’ back to Split In Batches

Keep the first Airtable Update Record inside the loop to mark each row as In Progress before processing. Run the workflow and watch items execute one at a time.

Note
Note

Why this shape works Marking all rows as In Progress at once can cause conflicts. A batch size of 1 keeps processing clean and sequential.

Giving Each Document a Unique Name

If all generated documents have the same title, include the ASIN in the file name. In Create a document β†’ Title, append the ASIN dynamically:

summary and tips - {{$json.asin}}

Re-run the workflow to confirm that each file name now includes the correct ASIN.

Writing the Results Back to Airtable

After the Google Doc is updated, finish by writing the results and document link back to Airtable.

  • Set / Edit Fields (to build a clickable Google Doc URL):

    • Field: doc_url;
    • Value (expression):.
https://docs.google.com/document/d/{{$node["Create a document"].json["id"]}}/edit
  • Airtable: update record:

    • Match on: ID (drag the record ID surfaced earlier);

    • Fields to update:

      • status β†’ Complete;
      • script β†’ LLM output (same text you inserted into the doc);
      • doc_link β†’ the doc_url value created above.

Execute the nodes and verify in Airtable that the row now shows Complete, along with a clickable link that opens the corresponding Google Doc.

question mark

Why is the Split In Batches node set to a batch size of 1 in this workflow?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 5. ChapterΒ 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain how to set up the loop for processing multiple ASINs?

How do I make sure each Google Doc has a unique name with the ASIN?

What steps are needed to write the document link back to Airtable?

Awesome!

Completion rate improved to 4.17

bookGenerating Docs and Updating Airtable

Swipe to show menu

To turn the AI output into a Google Doc, set up the workflow so it runs in a loop, processing multiple ASINs one by one. Each iteration creates or updates a document and then writes the status and document link back to Airtable. To make this work, add the following new nodes:

  • Google Docs: create a document;
  • Google Docs: update the document;
  • Split In Batches (or Loop Over Items) with batch size 1;
  • Airtable: Update the record with the final Complete status;
  • Set / Edit Fields to build a clickable Google Doc URL.

Creating and Updating the Google Doc

To generate a new Google Doc for each ASIN and fill it with the AI summary, add two Google Docs nodes in sequence.

  • Google Docs: create a document:

    • Drive: My Drive;
    • Folder: SaaS reports;
    • Title: summary and tips (temporary title).
  • Google Docs: Update a document:

    • Document ID/URL: drag from the Create a document output;
    • Text: drag the output of the AI Agent (the LLM's summary).

Execute the nodes, open Google Drive, and confirm that the created document contains the AI-generated text.

Note
Note

If the AI output isn't mapped into the Text field, Google Docs throws an insert text must be… error. Make sure the LLM result is mapped correctly, then re-run the node.

Batching and Looping the Workflow

To prevent multiple ASINs from running at once, batch the flow so it processes items one by one.

  • Airtable search records:

    • Limit: 10 (or the number you prefer);
    • This node stays outside the loop.
  • Split In Batches (or Loop Over Items):

    • Batch size: 1.

Connect the loop as follows:

Search Records β†’ Split In Batches β†’ (rest of the workflow) β†’ back to Split In Batches

Keep the first Airtable Update Record inside the loop to mark each row as In Progress before processing. Run the workflow and watch items execute one at a time.

Note
Note

Why this shape works Marking all rows as In Progress at once can cause conflicts. A batch size of 1 keeps processing clean and sequential.

Giving Each Document a Unique Name

If all generated documents have the same title, include the ASIN in the file name. In Create a document β†’ Title, append the ASIN dynamically:

summary and tips - {{$json.asin}}

Re-run the workflow to confirm that each file name now includes the correct ASIN.

Writing the Results Back to Airtable

After the Google Doc is updated, finish by writing the results and document link back to Airtable.

  • Set / Edit Fields (to build a clickable Google Doc URL):

    • Field: doc_url;
    • Value (expression):.
https://docs.google.com/document/d/{{$node["Create a document"].json["id"]}}/edit
  • Airtable: update record:

    • Match on: ID (drag the record ID surfaced earlier);

    • Fields to update:

      • status β†’ Complete;
      • script β†’ LLM output (same text you inserted into the doc);
      • doc_link β†’ the doc_url value created above.

Execute the nodes and verify in Airtable that the row now shows Complete, along with a clickable link that opens the corresponding Google Doc.

question mark

Why is the Split In Batches node set to a batch size of 1 in this workflow?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 5. ChapterΒ 3
some-alt