Stay organized with collections
Save and categorize content based on your preferences.
You can access data passed at runtime by adding a params field to your
workflow, which names the argument the workflow uses to store the data you
pass in. If passing in a JSON object, you can then use dot notation to access
the arguments. For example:
For a workflow to receive runtime arguments there must be a main block.
The main block accepts a single argument that is the name of any valid JSON
data type: an array, an object, or a string.
As a best practice, passing in an object with multiple, named arguments makes
it easier to understand their purpose, and to add arguments. You can also then
use dot notation to access the arguments.
Other subworkflows can have multiple arguments.
The following workflow returns a "Hello" greeting to a person whose first and
last name you pass as a string in JSON format to the workflow in an execution
request. For example, if you pass in the argument
{"firstName":"Workflows","lastName":"User"}, the results of the
execution should include the output "Hello, Workflows User".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Runtime arguments\n\nYou can access data passed at runtime by adding a `params` field to your\nworkflow, which names the argument the workflow uses to store the data you\npass in. If passing in a JSON object, you can then use dot notation to access\nthe arguments. For example: \n\n### YAML\n\n```yaml\n main:\n params: [ARG_NAME]\n steps:\n - step1:\n return: ${\u003cvar translate=\"no\"\u003eARG_NAME.PARAM_NAME\u003c/var\u003e}\n \n```\n\n### JSON\n\n```json\n {\n \"main\": {\n \"params\": [\"\u003cvar translate=\"no\"\u003eARG_NAME\u003c/var\u003e\",]\n \"steps\": [\n {\n \"step1\": {\n \"return\": \"${\u003cvar translate=\"no\"\u003eARG_NAME.PARAM_NAME\u003c/var\u003e}\"\n }\n }\n ]\n }\n }\n \n```\n\nNote the following:\n\n- For a workflow to receive runtime arguments there must be a `main` block.\n\n- The `main` block accepts a single argument that is the name of any valid JSON\n data type: an array, an object, or a string.\n\n- As a best practice, passing in an object with multiple, named arguments makes\n it easier to understand their purpose, and to add arguments. You can also then\n use dot notation to access the arguments.\n\n- Other subworkflows can have multiple arguments.\n\nThe following workflow returns a \"Hello\" greeting to a person whose first and\nlast name you pass as a string in JSON format to the workflow in an execution\nrequest. For example, if you pass in the argument\n`{\"firstName\":\"Workflows\",\"lastName\":\"User\"}`, the results of the\nexecution should include the output \"Hello, Workflows User\".\n\n\u003cbr /\u003e\n\n### YAML\n\n```yaml\n main:\n params: [person]\n steps:\n - step1:\n assign:\n - outputVar: ${\"Hello, \" + person.firstName + \" \" + person.lastName}\n - step2:\n return: ${outputVar}\n \n```\n\n### JSON\n\n```json\n {\n \"main\": {\n \"params\": [\n \"person\"\n ],\n \"steps\": [\n {\n \"step1\": {\n \"assign\": [\n {\n \"outputVar\": \"${\"Hello \" + person.firstName + \" \" + person.lastName}\"\n }\n ]\n }\n },\n {\n \"step2\": {\n \"return\": \"${outputVar}\"\n }\n }\n ]\n }\n }\n \n```\n\n\u003cbr /\u003e\n\nFor more information about using runtime arguments, see\n[Pass runtime arguments in an execution request](/workflows/docs/passing-runtime-arguments)."]]