Whenever I use the agent, I get the error: "Run failed: 'str' object has no attribute 'get'". #20890

Closed
opened 2026-02-21 20:09:41 -05:00 by yindo · 1 comment
Owner

Originally created by @KrisHe666 on GitHub (Dec 9, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Whenever I use the agent, I get the error: "Run failed: 'str' object has no attribute 'get'".

✔️ Expected Behavior

1

Actual Behavior

No response

Originally created by @KrisHe666 on GitHub (Dec 9, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Whenever I use the agent, I get the error: "Run failed: 'str' object has no attribute 'get'". ### ✔️ Expected Behavior 1 ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤖 feat:agent labels 2026-02-21 20:09:41 -05:00
yindo closed this issue 2026-02-21 20:09:41 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 9, 2025):

This error happens because the agent node expects certain parameters (like tool arrays) to be lists of dictionaries, but a string is being passed instead. This usually occurs if LLM auto-fill is disabled or if a variable bound to the parameter is a string, not a list of dicts. The backend then tries to call .get() on each item, which fails if the item is a string, resulting in the error you see. This is a known issue in Dify 1.10.1 and earlier versions example example.

To work around this:

  • Enable LLM auto-fill for the parameter in the Agent node (this ensures the correct type is passed).
  • If you must bind a variable or output, make sure it is actually a list of dictionaries, not a string.
  • If you’re passing JSON strings or variables with special characters (like double quotes), sanitize them or use double-serialization (json.dumps(json.dumps(obj))) to avoid parsing issues example.

There’s ongoing work to improve type validation and variable handling, but for now, keeping LLM auto-fill enabled or ensuring your variables match the expected structure is the safest approach. If you want help adjusting your workflow or node config, let me know your agent setup details!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 9, 2025): <!-- Answer --> This error happens because the agent node expects certain parameters (like tool arrays) to be lists of dictionaries, but a string is being passed instead. This usually occurs if LLM auto-fill is disabled or if a variable bound to the parameter is a string, not a list of dicts. The backend then tries to call `.get()` on each item, which fails if the item is a string, resulting in the error you see. This is a known issue in Dify 1.10.1 and earlier versions [example](https://github.com/langgenius/dify/issues/26559) [example](https://github.com/langgenius/dify/issues/21958). To work around this: - Enable LLM auto-fill for the parameter in the Agent node (this ensures the correct type is passed). - If you must bind a variable or output, make sure it is actually a list of dictionaries, not a string. - If you’re passing JSON strings or variables with special characters (like double quotes), sanitize them or use double-serialization (`json.dumps(json.dumps(obj))`) to avoid parsing issues [example](https://github.com/langgenius/dify/issues/23973). There’s ongoing work to improve type validation and variable handling, but for now, keeping LLM auto-fill enabled or ensuring your variables match the expected structure is the safest approach. If you want help adjusting your workflow or node config, let me know your agent setup details! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/91068b2c-0498-49d9-a71c-ac3430074ef3?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20error%20happens%20because%20the%20agent%20node%20expects%20certain%20parameters%20%28like%20tool%20arrays%29%20to%20be%20lists%20of%20dictionaries%2C%20but%20a%20string%20is%20being%20passed%20instead.%20This%20usually%20occurs%20if%20LLM%20auto-fill%20is%20disabled%20or%20if%20a%20variable%20bound%20to%20the%20parameter%20is%20a%20string%2C%20not%20a%20list%20of%20dicts.%20The%20backend%20then%20tries%20to%20call%20%60.get%28%29%60%20on%20each%20item%2C%20which%20fails%20if%20the%20item%20is%20a%20string%2C%20resulting%20in%20the%20error%20you%20see.%20This%20is%20a%20known%20issue%20in%20Dify%201.10.1%20and%20earlier%20versions%C2%A0%5Bexample%5D%28https%3A//github.com/langgenius/dify/issues/26559%29%C2%A0%5Bexample%5D%28https%3A//github.com/langgenius/dify/issues/21958%29.%0A%0ATo%20work%20around%20this%3A%0A-%20Enable%20LLM%20auto-fill%20for%20the%20parameter%20in%20the%20Agent%20node%20%28this%20ensures%20the%20correct%20type%20is%20passed%29.%0A-%20If%20you%20must%20bind%20a%20variable%20or%20output%2C%20make%20sure%20it%20is%20actually%20a%20list%20of%20dictionaries%2C%20not%20a%20string.%0A-%20If%20you%E2%80%99re%20passing%20JSON%20strings%20or%20variables%20with%20special%20characters%20%28like%20double%20quotes%29%2C%20sanitize%20them%20or%20use%20double-serialization%20%28%60json.dumps%28json.dumps%28obj%29%29%60%29%20to%20avoid%20parsing%20issues%C2%A0%5Bexample%5D%28https%3A//github.com/langgenius/dify/issues/23973%29.%0A%0AThere%E2%80%99s%20ongoing%20work%20to%20improve%20type%20validation%20and%20variable%20handling%2C%20but%20for%20now%2C%20keeping%20LLM%20auto-fill%20enabled%20or%20ensuring%20your%20variables%20match%20the%20expected%20structure%20is%20the%20safest%20approach.%20If%20you%20want%20help%20adjusting%20your%20workflow%20or%20node%20config%2C%20let%20me%20know%20your%20agent%20setup%20details%21)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29337)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20890