Is there anyways to get id from upsert or insert query?

I have workflow which upsert's transactional data and after that create data which related to that transaction.
therefore i need id which is updated or inserted during the workflow.

it seems information in return so im currently call select query by getting max(id) but assuming there is more than 2 people using same workflow will cause problem so i would like to know if there is anything better way to do.
Screenshot 2024-11-17 at 10.45.09

thanks in advance,

The only way i'm aware of is running a subsequent query with the keys that inserted the previous row and get the id back.

1 Like

Hi @kazutoshi.sugita can you also share what resource type is doing the upsert (MySQL, Postgres, etc)?