Skip to main content

Automate GPT-4o fine-tuning with Google Sheets or Airtable data

Workflow preview

Workflow preview
100%
Automate GPT-4o fine-tuning with Google Sheets or Airtable data preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? Anyone curating before/after text examples in a spreadsheet and wanting a push button path to a fine tuned GPT model—without touching curl. Works with Google Sheets or Airtable . W...

Best for

  • Engineering automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.wait, n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.stopanderror

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Matty Reed.

Original n8n.io source

1.1 Workflow description

Title
Automate GPT-4o fine-tuning with Google Sheets or Airtable data
Workflow name
Automate GPT-4o fine-tuning with Google Sheets or Airtable data

Who is this for?

Anyone curating before/after text examples in a spreadsheet and wanting a push-button path to a fine-tuned GPT model—without touching curl. Works with Google Sheets or Airtable.


What problem does it solve?

Manually downloading CSVs, converting to JSONL, uploading, and polling OpenAI is a slog.
This flow automates the whole loop: grab examples flagged Ready, build the JSONL file, start the fine-tune, then log the resulting model ID back to a registry sheet/table for reuse.


How it works

# Node Purpose
1 Schedule Trigger Runs weekly by default (change as needed).
2a Get Examples from Sheet Pulls rows where Ready = TRUE from your Google Sheet. Uses the JSONL-Template Sheet as the expected column layout.
2b Get Examples from Airtable (disabled) Alternate source for Airtable users.
3 Create JSONL File (Code) Converts each example to chat-format JSONL and splits into train.jsonl / val.jsonl (80/20).
4 Upload JSONL Uploads the training file to OpenAI (purpose: fine-tune).
5 Begin Fine-Tune Starts a fine-tune job on gpt-4o (editable).
6 Wait → Check Job → IF Polls every minute until status = succeeded.
7a Write Model to Sheet Appends the new model ID + meta to your Model Registry sheet.
7b Write Model to Airtable (disabled) Equivalent logging step for Airtable.

Setup steps

  1. Import & connect credentials

    • Import the JSON flow into n8n.
    • Add your OpenAI API key.
    • Google Sheets: create an OAuth2 credential and link it to both Sheets nodes.
    • Airtable (optional): create a Personal Access Token and attach it to the Airtable nodes.
  2. Copy the template sheet

    • Duplicate the JSONL-Template Sheet linked above into your own Drive.
    • Required columns (exact names):
      | systemPrompt | userPrompt | assistantResponse | Ready |
    • Tick Ready = TRUE for rows you want to include.
  3. Create the registry sheet/table

    • Google Sheet (or Airtable table) named Model Registry with columns:
      Model ID, Training Examples, Epochs, Batch Size, Learning Rate, Finished At.
  4. Tweak model & schedule

    • Change the base model in Begin Fine-Tune if desired.
    • Adjust the Schedule Trigger for daily / on-demand runs.
  5. Test it

    • Mark a few examples Ready = TRUE.
    • Run the flow manually.
    • Check OpenAI for the new fine-tune job and confirm the model ID is logged in your registry.

Resources


Extending the flow

  • Webhook trigger – swap the schedule for a webhook to train on demand.
  • Multi-source merge – enable both Sheets and Airtable nodes to combine datasets.
  • Auto-deploy – save the new model name to an env-var or Secrets Manager for downstream generation workflows.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 2 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 3 - Set GPT Model

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Begin Fine-tune Job

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Upload JSONL File

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 6 - Create JSONL File

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Check Fine-Tune Job

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - If Succeeded

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - If Failed

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 10 - Error: FAILED

Type / Role
n8n-nodes-base.stopAndError - stopAndError
Config choices
Version 1

Block 11 - Add Fine-Tuned Model to Airtable

Type / Role
n8n-nodes-base.airtable - airtable
Config choices
Version 2.1

Block 12 - Add Fine-Tuned Model to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 13 - Get Examples from Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 14 - Get Examples from Airtable

Type / Role
n8n-nodes-base.airtable - airtable
Config choices
Version 2.1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automate GPT-4o fine-tuning with Google Sheets or Airtable data
Complexity advanced
Nodes 19
Categories Engineering, Multimodal AI
Author Matty Reed
Published 10 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4853/4853.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate GPT-4o fine-tuning with Google Sheets or Airtable data do?

Who is this for? Anyone curating before/after text examples in a spreadsheet and wanting a push button path to a fine tuned GPT model—without touching curl. Works with Google Sheets or Airtable . W...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, Multimodal AI use case.