Hi everyone,
I’m setting up a Shopify Flow automation to email customers their eSIM details after purchase. My workflow is as follows:
-
Trigger: Order paid
-
Condition: Line item title contains “eSIM”
-
Action: Send HTTP request to an external API to assign an eSIM
-
Condition: HTTP response status is 200
-
Action: Run code (JavaScript) to parse the HTTP response and output two fields:
iccidandqr_code_url -
Action: Send marketing email to the customer, including their ICCID and QR code link using Liquid variables (e.g.,
{{ runCode.iccid }}and{{ runCode.qr_code_url }})
Issue:
Despite returning the iccid and qr_code_url fields from my Run code step and referencing them as {{ runCode.iccid }} and {{ runCode.qr_code_url }} in the email template, the values do not render in the emails sent to customers. I’ve also added debug: {{ runCode | json }} to the template, and it outputs null in the received email. However, my Run code output in the Flow logs clearly shows that these fields are being returned correctly.
I’ve confirmed:
-
The “Send marketing email” action is directly after the Run code step (no branching).
-
I am using the correct variable names and Output schema.
-
The workflow is linear—no parallel paths or branches that would affect variable scope.
-
If I use Shopify Flow’s “Send internal email,” I can only send to static addresses and not the customer.
Question:
Has anyone successfully passed Run code output variables into a “Send marketing email” step in Shopify Flow?
Is there something I’m missing regarding variable scope, timing, or Flow configuration to make these dynamic values available in the marketing email to the customer?
Any help or examples would be greatly appreciated!