Skip to content

Flowise Requests Get/Post don’t interpolate $flow.state variables — backend receives the literal {{ … }} string #5150

@MartinMiklos17

Description

@MartinMiklos17

Describe the bug

I’m wiring an Agent that calls Requests Get / Requests Post nodes. In the HTTP node fields (URL / Headers / Body), I reference runtime variables like:

{
"Content-Type": "application/json",
"X-Chat-Flow-Id": "{{$flow.state.ownChatFlowId}}"
}

and in the URL / body I also use values such as {{$flow.state.ownCurrentDateTime}}, {{$flow.state.name}}, etc.

Expected: Flowise evaluates the expressions and sends the actual values to my API.

Actual: On the backend I receive the literal strings (percent-encoded in the URL, or verbatim in headers/body), e.g.

X-Chat-Flow-Id: "{{ $flow.state.ownChatFlowId }}"

so my server never sees the real value.

Repro steps (minimal)

In a Requests GET node, set:

URL: https:///endpoint?from={{ $flow.state.ownCurrentDateTime }}

Headers (JSON):

{
"Content-Type": "application/json",
"X-Chat-Flow-Id": "{{$flow.state.ownChatFlowId}}"
}

Trigger the Agent so those keys exist in $flow.state.

Inspect the request server-side → headers/URL contain {{ … }} literally.

Notes / things I already tried

Toggled the little (x) “expression” toggle to ON for URL / Headers / Body.

Same result whether I put variables in URL, Headers or Body.

Exported the flow JSON and sometimes see HTML wrappers saved into these fields (e.g.

{ ... }

or <span class="variable" ...> {{ ... }} ), even when the UI shows clean text.

If I build the URL/body in a Custom Function and pass its string output into the Requests node ({{$prevNode.output}}), it works (because I avoid templating in the HTTP fields).

I’d prefer not to move all interpolation to Custom Function nodes — I just want Requests to substitute values reliably.

Questions

Is there a known issue where Requests nodes don’t interpolate expressions in URL/Headers/Body (especially when invoked from an Agent)?

Is there a way to force plain-text / no-HTML for those fields so {{ ... }} evaluates consistently?

Any recommended workarounds besides “build everything in a Custom Function and pass a single string into the HTTP node”?

Image Image

To Reproduce

Context: A parent Agent calls HTTP tools (requests_get / requests_post) and injects $flow.state.* variables into URL/headers/body via the variable picker. The backend receives the literal string (or HTML-wrapped) instead of the interpolated value.

Setup

Create a new Agentflow with nodes: Start → Agent (no other HTTP nodes).

In the Agent node:

Model: any OpenAI model (e.g. gpt-4o-mini).

Tools → Add Tool → HTTP (requests_get).

Configure:

URL: https:///api/appointments/availability

Headers:

Key: X-Chat-Flow-Id

Value: insert variable via picker → {{ $flow.state.ownChatFlowId }}

Query params:

from = {{ $flow.state.ownCurrentDateTime }}

to = {{ $flow.state.ownCurrentDateTime }}

(Optional) Also add requests_post tool and in Body (JSON) include:

{
"title": "Dental appointment with {{ $flow.state.name }}",
"event_name": "Dental appointment",
"description": "Auto-scheduled via chat.\nEmail: {{ $flow.state.email }}\nPhone: {{ $flow.state.phone }}",
"start": "{{ $flow.state.start }}",
"end": "{{ $flow.state.end }}"
}

In Start → Flow State, set dummy values so the agent has something to interpolate (e.g. ownChatFlowId = test-123, ownCurrentDateTime = 2025-09-01T09:00:00-04:00).

Steps

Run the Agentflow and ask the agent to “check availability” (so it decides to call the requests_get tool).

Inspect your API server logs for the incoming request.

Expected

The backend receives:

Header X-Chat-Flow-Id: test-123

Query params from=2025-09-01T09:00:00-04:00 and to=2025-09-01T09:00:00-04:00 (or whatever values you set).

Actual

The backend receives literal strings instead of interpolated values, e.g.:

X-Chat-Flow-Id: {{ $flow.state.ownChatFlowId }}

from={{ $flow.state.ownCurrentDateTime }}

In some cases the payload arrives HTML-wrapped (e.g.,

...

<span class="variable" ...>{{ $flow.state.ownChatFlowId }}) which matches what’s visible in the exported flow JSON under the Agent tool configuration (e.g., requestsGetHeaders contains a

{ "chatFlowId": "<span class="variable" ...>{{ $flow.state.ownChatFlowId }} " }

).

Notes

The issue only occurs when the HTTP node is added as a Tool inside an Agent (Agent → Tools → HTTP). When using standalone HTTP nodes after the Agent in the canvas, behavior may differ.

Toggling any “expression/fx” UI (when available) didn’t change the outcome.

The same happens for headers, URL, query params, and JSON body—variables are not resolved and are sent literally/HTML-wrapped.

Expected behavior

When an Agent calls requests_get / requests_post as Tools and the tool’s URL / Headers / Query Params / Body contain expressions like {{$flow.state.*}} (or $flow.chatflowId, $flow.chatId, $flow.sessionId):

Interpolation happens before the HTTP request is sent.

All {{ … }} expressions are evaluated to their actual runtime values taken from the same $flow context the Agent sees.

No {{ … }} literals or percent-encoded braces reach the server.

No hidden HTML is stored or transmitted.

The tool config persists as plain strings (no

, , etc.).

Clearing a field yields an empty value (not HTML-wrapped “empty”), and JSON fields are only parsed when non-empty.

Consistency across fields and modes.

Interpolation works the same in URL, Headers, Query Params, and Body (JSON/Raw).

Behavior is identical whether the HTTP node is used as a Tool inside an Agent or as a standalone node on the canvas.

Type-safe output.

After interpolation, the tool sends valid JSON when Body Type = JSON (strings stay strings, numbers stay numbers).

Headers are plain strings with the resolved values.

Failure mode is explicit.

If a referenced variable is missing, the tool either substitutes an empty string or returns a clear validation error before attempting the request (no half-baked {{ … }} is sent).

Concrete example (expected server-side log):

Headers:

X-Chat-Flow-Id: cf_demo_123
Content-Type: application/json

Query:

from=2025-09-01T09:00:00-04:00
to=2025-09-08T09:00:00-04:00

Body (JSON):

{
"title": "Dental appointment with Jane Smith",
"event_name": "Dental appointment",
"description": "Auto-scheduled via chat.\nEmail: jane@example.com\nPhone: +15551234567",
"start": "2025-09-14T10:30:00-04:00",
"end": null
}

No {{ … }} literals, no HTML wrappers, and values match the current $flow.state.* at tool invocation time.

Screenshots

Image Image

Flow

No response

Use Method

None

Flowise Version

3.0.5

Operating System

Windows

Browser

Chrome

Additional context

I use flowise with a forked github, hosted via render.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingin-workIssue in work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions