Skip to main content
Skip table of contents

How-To: Reference Workflows Environment Variables in File Names

When setting up output filenames, you can use environment variables to automatically insert timestamps from either the Workflow run or the Task run. This ensures each file is named consistently and avoids accidental overwrites.

  • Workflow variables reflect when the overall workflow started.

  • Task variables reflect when a specific task inside that workflow started.

  • You can combine these variables with text (like report_ or data_) to create clear, predictable file names.

For example, if your workflow starts on May 8, 2025 at 7:31 PM, a filename like:

CODE
filename_${MARKETPLACE_WORKFLOWRUN_START_TIME_YEAR}${MARKETPLACE_WORKFLOWRUN_START_TIME_MONTH}${MARKETPLACE_WORKFLOWRUN_START_TIME_DAY}.csv

would produce:

CODE
filename_20250508.csv

Important: Two-digit years (YY) are not supported — only four-digit years (YYYY).

The tables below show common patterns you can copy and adapt depending on whether you want to use Workflow-level or Task-level variables.

To see a full list of workflow environment variables, check out Workflow's Environment Variables

Note: some variables are secure credentials and should be treated as such - never use anything like a oauth token, password, alli client cred, s3 or redshift information, Google Cloud information. etc

Reference the workflow or taskrun executions only in filenames for maximum security!

Workflow Specific

File Name Pattern

What to Input

Example Output

filename_MMDDYYYY.csv

filename_${MARKETPLACE_WORKFLOWRUN_START_TIME_MONTH}${MARKETPLACE_WORKFLOWRUN_START_TIME_DAY}${MARKETPLACE_WORKFLOWRUN_START_TIME_YEAR}.csv

filename_05082025.csv

filename_EPOCH.csv

filename_${MARKETPLACE_TASKRUN_START_TIME_EPOCH}.csv

filename_1670443778.csv

filename_YYYY-MM-DD.csv

filename_${MARKETPLACE_WORKFLOWRUN_START_TIME_YEAR}-${MARKETPLACE_WORKFLOWRUN_START_TIME_MONTH}-${MARKETPLACE_WORKFLOWRUN_START_TIME_DAY}.csv

filename_2025-05-08.csv

filename_HHMMSS.csv

filename_${MARKETPLACE_TASKRUN_START_TIME_HOUR}${MARKETPLACE_TASKRUN_START_TIME_MINUTE}${MARKETPLACE_TASKRUN_START_TIME_SECOND}.csv

filename_193129.csv

filename_fulltimestamp.csv

filename_${MARKETPLACE_WORKFLOWRUN_START_TIME}.csv

filename_2025-05-08T19:31:29Z.csv

filename_DateHour.csv

filename_${MARKETPLACE_WORKFLOWRUN_START_TIME_YEAR}${MARKETPLACE_WORKFLOWRUN_START_TIME_MONTH}${MARKETPLACE_WORKFLOWRUN_START_TIME_DAY}_${MARKETPLACE_WORKFLOWRUN_START_TIME_HOUR}.csv

filename_20250508_19.csv

Task Specific

File Name Pattern

What to Input

Example Output

filename_MMDDYYYY.csv

`filename_${MARKETPLACE_TASKRUN_START_TIME_MONTH}${MARKETPLACE_TASKRUN_START_TIME_DAY}${MARKETPLACE_TASKRUN_START_TIME_YEAR}.csv`

filename_05082025.csv

filename_EPOCH.csv

filename_${MARKETPLACE_TASKRUN_START_TIME_EPOCH}.csv

filename_1670443778.csv

filename_YYYY-MM-DD.csv

filename_${MARKETPLACE_TASKRUN_START_TIME_YEAR}-${MARKETPLACE_TASKRUN_START_TIME_MONTH}-${MARKETPLACE_TASKRUN_START_TIME_DAY}.csv

filename_2025-05-08.csv

filename_HHMMSS.csv

filename_${MARKETPLACE_TASKRUN_START_TIME_HOUR}${MARKETPLACE_TASKRUN_START_TIME_MINUTE}${MARKETPLACE_TASKRUN_START_TIME_SECOND}.csv

filename_193129.csv

filename_DateHour.csv

filename_${MARKETPLACE_TASKRUN_START_TIME_YEAR}${MARKETPLACE_TASKRUN_START_TIME_MONTH}${MARKETPLACE_TASKRUN_START_TIME_DAY}_${MARKETPLACE_TASKRUN_START_TIME_HOUR}.csv

filename_20250508_19.csv

filename_fulltimestamp.csv

filename_${MARKETPLACE_TASKRUN_SCHEDULED_TIME}.csv

filename_2025-05-08T19:31:22Z.csv

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.