For the complete documentation index, see llms.txt. This page is also available as Markdown.

Passing and Using Run Time Parameters in Your Code

If you want to re-use your code, but need to make some small changes without hardcoding them, Run Parameters and Run Secrets can be very helpful.

Passing Run Parameters

When you are ready to run your code, you'll be able to provide parameters in either RUN PARAMETERS or RUN SECRETS, see a screenshot below and more detail in What is a Code Object?.

Loading/Using Run Parameters

To use the parameters, simply access them by reading the JSON file in which they are stored. The parameters will be stored in "/input/run_params.json" and in "/input/secret_run_params.json" for RUN PARAMETERS and RUN SECRETS PARAMETERS respectively. For example, let's say you want to pass "my_parameter" = 55555, in RUN PARAMETERS. In the UI, you'll set the following RUN PARAMETER:

If you were to write Python code, in your code first you'd read /input/run_params.json:

and last you'd access the value of your parameter as follows:

For RUN SECRETS PARAMETERS the process would be almost identical except that you would set the parameters in the RUN SECRET PARAMETERS input form, and you would read them from /input/secret_run_params.json.

Last updated

Was this helpful?