> For the complete documentation index, see [llms.txt](https://docs.rhinofcp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rhinofcp.com/creating-and-running-code-objects/passing-and-using-run-time-parameters-in-your-code.md).

# 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?](/creating-and-running-code-objects/what-is-a-code-object.md).

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/WCrcpa9jZV8PcEl10bzK/19771670256925)

#### 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:

```json
{"my_parameter": 55555}
```

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

```python
parameter_key = "my_parameter"

run_params = {}
run_params_filename = "/input/run_params.json"
try:
  with open(run_params_filename, "r") as run_params_file:
  run_params = json.load(run_params_file)
except IOError:
  logging.error("No params file found")
  sys.exit(1)
except json.JSONDecodeError:
  logging.error("Invalid JSON found in params file")
  sys.exit(1)

if parameter_key not in run_params:
  logging.error(f"Key '{parameter_key}' not found in run parameters")
  sys.exit(1)
```

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

```python
my_parameter_value = run_params[parameter_key]
```

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rhinofcp.com/creating-and-running-code-objects/passing-and-using-run-time-parameters-in-your-code.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
