Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add documentation of referencing parameters using jinja2 templating syntax #1614

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions docs/workflows/what-is-a-parameter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ Create this value when you have details that vary from run-to-run:
<img src="/images/what_is_a_parameter/u.2.png"/>


## Future Plans for Parameters
## Referencing Parameters Using JINJA2 Templating Syntax

Our main goal is to make every field a parameterized field and remove block parameters
You can reference any parameter in your workflows by using the `{{ parameter_key }}` syntax in any input field.

* We know it’s confusing, but it’s only temporary! In the future we’re headed toward loading parameters directly into each input field.
* One day, your prompt may look like “Find the invoices page using **/how_to_find_invoices_page**, filter the invoices using **/start_date** and **/end_date** provided.” Or perhaps brackets as are traditionally used in code.
For example, if you have a parameter with the key `website_url`, you can reference it in a task block by using `{{ website_url }}` in the URL field.

### Referencing Block Output
A block can have output. To reference the output of a block, you can use the `{{ block_label.output }}` syntax.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we haven't launched the format like {{ block_label.output }}. we only support {{ block_label_output }} today. Same issue for the screenshot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't want users to use {{ block_label_output }} which we want to deprecate, so we can wait here


In the following example, the "send_email" block references the output of "extract_stock_price" block in the body field and sends an email with the stock price.
<img src="/images/what_is_a_parameter/workflow_block_output_example.png"/>
Loading