Can I use variables in workflows? Details below

Hi everyone,

I have a Workflow currently like this:

get_quote_sites executes and returns either 0 or 1 result. If the result is 0, it runs the create_quote_site path and creates a record. If the result is 1, then it proceeds without creating one.

In my query6 step though I want to reference these values in a new query but I'm not sure how. What I'm trying to accomplish is:

If the top path create_quote_site was taken, set the value to be used/referenced to be the "id" field from the create_quote_site step. However, if it did not take this step, then use/reference the "id" of the row found in the get_quote_sites step.

Basically, I almost want a variable step where "query6" is, where it sets the variable to be either the id of the newly created record, or the id of the found records. If this was Power Automate which I'm more used to, I'd just add a variable step after each path and have it set that variable to be the applicable id, and then reference the variable in future steps, but I don't see any mention of variables or states here. Hope this makes sense!

Hey @Psycho_Bunny! I wonder if using a code block might work here. You could have the code block return whatever value you need with something like

return get_quotes_sites.data[1] || create_quote_site.data;

(I assume that code is very wrong but hopefully it communicates the idea :sweat_smile: )

Then, later in your workflow, you can reference {{ yourCodeBlock.data }} to get the value.

What do you think?