ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: 0.19.0 template component unable to handle input.

Open KB4EVER opened this issue 7 months ago • 4 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (Language Policy).
  • [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • [x] Please do not modify this template :) and fill in all the required fields.

Describe your problem

0.19.0 version template component doesn't have key value Image 0.16.0 version can use jinja to edit output

Image

KB4EVER avatar Jun 17 '25 05:06 KB4EVER

Hi @KB4EVER! I'm Dosu and I’m helping the ragflow team.

The template component in 0.19.0 still supports Jinja and variable input, but the UI for picking variables (key values) is now more context-sensitive to your workflow graph. If the workflow context (like upstream nodes or global variables) isn't set up or propagated correctly, the variable picker may not show available keys, making it look like the template can't handle input—even though the backend logic hasn't changed in this area. The expected sources for keys are still component outputs and "Begin" inputs, as described in the docs. Double-check your workflow graph and ensure the relevant upstream nodes or global variables are present and connected—this should surface the variable options in the template editor as before. The underlying template logic and Jinja rendering remain intact in 0.19.0 reference docs.

If you still don't see variable options, check for any missing context in your workflow setup or possible UI regressions.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

dosubot[bot] avatar Jun 17 '25 06:06 dosubot[bot]

@dosu Can you show me how to use this component?

The output of the invoke component is { content: { 0: ""{"isFail": 0, "innerwideip": "pgastore04.dccnet.com.cn"}"" } }

Image

Image

{% set ip_part = {"isFail": 0, "innerwideip": "pgastore04.dccnet.com.cn"}.split('"innerwideip": "')[1] %} {{ ip_part.split('"')[0] | trim }}

I the output should be pgastore04.dccnet.com.cn

KB4EVER avatar Jun 17 '25 06:06 KB4EVER

You can extract the innerwideip value directly in the Template component using Jinja2 like this:

{{ Invoke_0.innerwideip }}

Here, Invoke_0 is the ID of your invoke component. The Template component automatically parses the upstream JSON output and exposes its fields as variables in the template context, so you don't need to do any manual string splitting or parsing if the input is valid JSON. Just reference the field you want with dot notation.

If you don't see Invoke_0 as an available variable, make sure your workflow connects the invoke component output to the template component input, and that the output is valid JSON (not double-encoded or malformed). The variable picker UI in 0.19.0 is context-sensitive, so the right connections are required for variables to appear in the editor.
Reference: implementation details
Reference: documentation

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

dosubot[bot] avatar Jun 17 '25 06:06 dosubot[bot]

@dosu.according to your suggestion, {{ Invoke_0.innerwideip }} still doesn't work out, the output of template component is { content: { 0: "" } } Image

KB4EVER avatar Jun 17 '25 08:06 KB4EVER

@yongtenglei @KevinHuSh new code still doesn't work out

Image

Image

KB4EVER avatar Jun 19 '25 06:06 KB4EVER

Image Image

yongtenglei avatar Jun 19 '25 07:06 yongtenglei

I have tried on https://demo.ragflow.io/flow/ this online modal still doesn't work Image

KB4EVER avatar Jun 19 '25 09:06 KB4EVER

Hi, @KB4EVER

The latest code will sync to demo next week.

yongtenglei avatar Jun 19 '25 10:06 yongtenglei

There are still issues with the demo version of Jinja2

wuqilei-code avatar Jul 18 '25 10:07 wuqilei-code

Hi, @wuqilei-code

Image Image

yongtenglei avatar Jul 18 '25 10:07 yongtenglei