Pass input data from trigger to Run code action

Topic summary

A user encountered an issue passing the scheduledAt variable from a scheduled trigger to a Run code action in Shopify Flow. When attempting to log the value, it returned NaN instead of the expected data.

Problem identified:

  • The variable scheduledAt was being reassigned within the JavaScript code, causing the reference error
  • Additionally, input.shop.timezoneOffsetMinutes was referenced but not included in the input query

Resolution:

  • After the coding mistake was pointed out, the user corrected the variable assignment
  • The workflow now functions as intended

The issue is resolved — the data now passes correctly from the trigger to the Run code action.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Following on from the solution to my question here, I would like to know how to pass input data from a scheduled trigger to a Run code action in a workflow. As per the screenshots below, I am trying to retrieve the scheduledAt variable within a Run code action; but when I log its value to the console, it shows as NaN.

You are reassigning scheduledAt to be a a different variable, so that JavaScript is not working.

input.shop.timezoneOffsetMinutes is not in your input query, but there might be other issues.

1 Like

Thanks Paul - I can’t believe I made that mistake! Dearie me … it’s working now.