Calling automation in a loop on just created record

Calling an automation on a just created records is not possible, right?

  • I can call on current - which is the one that startet the automation, not the ā€œcurrentā€ record in the loop
  • I can call on collected - again, not the one I just created.

So I will probably need to split it up again and have the automation triggered on created.
Even more I vote for automations to be called by different triggers in parallel updated/created… etc.

I think technically it is possible but you would need a script block a use the api sdk trigger the workflow on the new record-ID

I’m on my phone right now so I can’t give you an example. But can try and knock one up later if it’s of interest.

1 Like

Brilliant! Of course there’s no API to ā€œtriggerā€ anything in Tape’s automation workflow on an item, but it’s a brilliant idea to use the SDK to create the item, get the created item ID (which the base UI doesn’t give you, I’ve learned) and then run an update on that item to update a category field or some other field that would trigger that particular workflow for you.

I have finally made it to a computer so for anyone that is interested in this:


:point_up: - I would normally do this in one script block but to keep it as low code as possible, you can call a workflow on the newly created record with a single line of code:

tape.Workflow.triggerWorkflow(309442,{trigger_on_record_id:created_shortcuts_test_ID});

that will trigger workflow 309442 on the newly created record:


this console.log(current_workflow_id); will give you the workflow number in my case 309442

Hope that helps

PS: As you were looking for a loop on a collection:

const appId = 62167;
const ev = `$.{
  "record_id": record_id,
  "fields": {
    "name": fields[external_id="document_title"].values.value_string
  }
}[]`

const inputs = jsonata(ev).evaluate(record_collection_documents);
console.log(JSON.stringify(inputs));

const { data: creationResponse } =  await tape.Record.batchCreate(appId,{
    inputs
});

const recordIDs = jsonata(`*.record_id[]`).evaluate(creationResponse);
console.info(JSON.stringify(recordIDs));

recordIDs.forEach(id => {
  tape.Workflow.triggerWorkflow(309457, {
    trigger_on_record_id: id
  });
});
4 Likes

Its always impressive, how you and others find workarounds with custom code :wink:
Thanks a lot - it will help me now to finish it.

On the other side, its supposed to be a LowCode platform. People, who want to build a LowCode App should have a way to call an automation of a just created record, right? :wink:

1 Like

Wow, I didn’t know that you can call automations in script like:
tape.Workflow.triggerWorkflow(309442,{trigger_on_record_id:created_shortcuts_test_ID});

It took me a minute to realise how powerful that is.
How did you find this one out? :rocket:

3 Likes

I couldn’t agree more on the created record I am not 100% but I think the created record_id being available at all is a relatively new thing.

I was trying to build something today in a ā€˜low code’ way in the end I gave up and just wrote it all in one script block. I was creating records within conditionals and then wanting to interact with the new records and it was ā€˜annoying’.

All that been said the ability to do so much in a script block is one of the things I love about Tape and thinking back it was probably the difficulty in interacting with newly created records that got me looking more into what you can do with the script block :wink:

3 Likes

Type in tape . Then start typing what aspect of Tape you might want to interact with for example: record if it is available it will auto complete then type another . And start typing what you might want to do create and if it’s available it will again auto complete then type a bracket pair ( (it will autocomplete the closing one) mouse over the last word in your dot sequence and it will generally tell you what you need to put in the brackets. I say generally as ironically the trigger workflow one doesn’t really give you much.

CleanShot 2025-06-16 at 22.27.09

So basically trial and error :wink:

Also once you are in the { } pair you should be able to type ctrl+Space and it should give you some options as what keys should be there (I do find this a little hit or miss on my machine)

1 Like

@Jason could this be of any help for more than trial and error?

1 Like

The Developer docs site I look at all the time.

The tape-sdk.types.ts makes my head explode :wink:

2 Likes