Skip to main content

Hi everyone! Hoping someone here can give me a hand 🙂

Context

I’m building an automation with n8n + Airtable to generate training plans and workouts.

Airtable structure

I have two tables:

  1. Training Plans

    • Each record corresponds to one person (with their athletic info).

    • This record is the input for generating workouts.

  2. Workouts

    • This is where the sessions created by OpenAI through n8n are stored (workout type, description, etc.).

    • It has a field “Link to another record†pointing to Training Plans, so each workout can be linked back to its plan.

Desired relationship:

  • One plan (1) → many workouts (N).

  • Every workout should be linked to the correct training plan for that person.

What I need

I want the automation in n8n to not only create the workout records in Workouts but also automatically link them to the corresponding Training Plan (via the Link to another record field).

Where I’m stuck

The workouts are being created fine (with type, description, etc.), but the link to the plan isn’t being set.
From what I understand, Airtable requires you to send the recordId of the plan (not just the name) into the Link to another record field — but I’m not sure how to format/pass that correctly from n8n when creating the workout.

What I’m looking for exactly

  • The right way to send the link from n8n when creating a new record in Workouts (e.g., should it be an array like {id: "recXXXX"}?).

  • An example configuration of the Airtable node in n8n (or using HTTP Request with the API) that shows how to properly populate a Link to another record field with the correct plan ID.

Thanks a lot in advance for any pointers! 🙌

Airtable expects an array for linking to other records.

So you need to input it like this in n8n:  "Airtable Record ID"], if you want to link multiple records you can too, like: "ID1","ID2"]

Beware that when using Typecast, it may just create a new record on the linked table instead. So if your original node needs to use Typecast, add another one after for linking the recently created record


I’m more familiar with Make or using built-in Airtable automations, but a couple considerations that may be helpful… 

  • You should be able to pass through the recID from Airtable into n8N either in the build directly, or at worst by creating a formula field in the Training Plan Airtable with the function Record_ID() which will expose the recID as a string in the record.
  • Usually Airtable will accept the record name (primary field) in lieu of the recID, but depending on your primary field that can get messy as primary fields can be duplicative (and formula fields as primaries can occasionally cause timing problems as the formula needs to populate before the other table can establish the link) 

Hey ​@rubennavarrom,

Exactly as mentioned by ​@Hugo Dias above, n8n is expecting an array when working with linked records.  Therefore, you’ll need the nbrackets]

Examples below.
 

{{ > $json{"recordId"] ] }}

 

{{ e $json>"id"] ] }}


Hope this helps! Feel free to reach out if you need any help setting this up!

Mike, Consultant @ Automatic Nation 
YouTube Channel​​​​​​


Perfect! This worked exactly as you described, ​@Hugo Dias 

The key was using the array format d"Record_ID"] for the linking field in n8n. I added:

"Training Plan": "={{ {$('Get a record').item.json.id] }}"

And set the schema field to "removed": false instead of "removed": true.

The workouts are now automatically linking to the correct training plans. Thanks for the precise solution - the array format was exactly what Airtable needed.


Yup! For anybody looking for further information on this matter, it might make sense to take a look at Airtable’s API documentation when it comes to Link to Another Record field values.

As shown, this is expecting an Array! Hope this provide some more context to it.

 



Mike, Consultant @ Automatic Nation 
YouTube Channel