Add current_date to reserved parameters list (#SKY-7547) (#4854)
Some checks are pending
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Celal Zamanoğlu 2026-02-24 03:12:44 +03:00 committed by GitHub
parent e6db283069
commit a520559856
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 1 deletions

View file

@ -54,7 +54,14 @@ Pick the credential to use when running the workflow when you have defined a cre
## Reserved Parameters
There are some parameters that are reserved by Skyvern and cannot be used as a parameter key/name:
- `{{current_value}}`: this is a reserved parameter within the scope of a for loop block. It represents the current value that the loop is iterating over.
- `{{current_item}}`: the current item in a for-loop block iteration (alias for `current_value`).
- `{{current_value}}`: the current value that the for-loop block is iterating over.
- `{{current_index}}`: the zero-based index of the current for-loop iteration.
- `{{current_date}}`: automatically resolves to the current date in YYYY-MM-DD format (UTC).
- `{{workflow_title}}`: the title of the workflow.
- `{{workflow_id}}`: the unique ID of the workflow definition.
- `{{workflow_permanent_id}}`: the permanent ID that persists across workflow versions.
- `{{workflow_run_id}}`: the unique ID of the current workflow run.
## Block Output Parameters
Any block name ({{your_block_name}} or {{your_block_name_output}}) can be referenced as a parameter by a later block, with the exception of referencing a block within a for loop from outside of the for loop block.

View file

@ -180,6 +180,11 @@ function WorkflowParameterEditPanel({
"current_item",
"current_value",
"current_index",
"current_date",
"workflow_title",
"workflow_id",
"workflow_permanent_id",
"workflow_run_id",
"workflow_run_outputs",
];
const isCloud = useContext(CloudContext);

View file

@ -117,6 +117,9 @@ else:
jinja_sandbox_env = SandboxedEnvironment()
# Date format used for the built-in {{current_date}} reserved parameter.
CURRENT_DATE_FORMAT = "%Y-%m-%d"
# Sentinel marker for native JSON type injection via | json filter.
_JSON_TYPE_MARKER = "__SKYVERN_RAW_JSON__"
@ -399,6 +402,8 @@ class Block(BaseModel, abc.ABC):
template_data["workflow_permanent_id"] = workflow_run_context.workflow_permanent_id
if "workflow_run_id" not in template_data:
template_data["workflow_run_id"] = workflow_run_context.workflow_run_id
if "current_date" not in template_data:
template_data["current_date"] = datetime.now(timezone.utc).strftime(CURRENT_DATE_FORMAT)
template_data["workflow_run_outputs"] = workflow_run_context.workflow_run_outputs
template_data["workflow_run_summary"] = workflow_run_context.build_workflow_run_summary()
@ -5059,6 +5064,7 @@ class BranchEvaluationContext:
template_data.setdefault("workflow_id", ctx.workflow_id)
template_data.setdefault("workflow_permanent_id", ctx.workflow_permanent_id)
template_data.setdefault("workflow_run_id", ctx.workflow_run_id)
template_data.setdefault("current_date", datetime.now(timezone.utc).strftime(CURRENT_DATE_FORMAT))
template_data.setdefault("params", template_data.get("params", {}))
template_data.setdefault("outputs", template_data.get("outputs", {}))

View file

@ -12,6 +12,7 @@ RESERVED_PARAMETER_KEYS = [
"current_item",
"current_value",
"current_index",
"current_date",
"workflow_title",
"workflow_id",
"workflow_permanent_id",