Automation + Script: How get the new record when the automation is triggered

Hi

I have 3 tables and I created a script that fill some columns across the first table with data from the others two tables (it is a kind of manually link). It works fine. So now I created an automation to run this script when a record is created in the first table.

But it is getting too long because my script run across all record. For the script used in automations, I would like to run my code just for the new record. So is there a way to get just the new record that triggered the automation to avoid run the code for all record of table every time?

use an input variable to pull the id of the trigger record.