[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/workflows/docs/reference/syntax/runtime-args [Back]  [Original]

Runtime arguments  |  Workflows  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Runtime arguments 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:

YAML

  main:
      params: [ARG_NAME]
      steps:
        - step1:
            return: ${ARG_NAME.PARAM_NAME}
  

JSON

  {
    "main": {
      "params": ["ARG_NAME",]
      "steps": [
        {
          "step1": {
            "return": "${ARG_NAME.PARAM_NAME}"
          }
        }
      ]
    }
  }
    

Note the following:

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".

YAML

    main:
      params: [person]
      steps:
        - step1:
            assign:
              - outputVar: ${"Hello, " + person.firstName + " " + person.lastName}
        - step2:
            return: ${outputVar}
    

JSON

    {
      "main": {
        "params": [
          "person"
        ],
        "steps": [
          {
            "step1": {
              "assign": [
                {
                  "outputVar": "${"Hello " + person.firstName + " " + person.lastName}"
                }
              ]
            }
          },
          {
            "step2": {
              "return": "${outputVar}"
            }
          }
        ]
      }
    }
      

For more information about using runtime arguments, see Pass runtime arguments in an execution request.

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-26 UTC.

Need to tell us more? [[["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 2026-08-26 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page