Agent using workflow exception #14286

Closed
opened 2026-02-21 19:16:31 -05:00 by yindo · 1 comment
Owner

Originally created by @1578411229 on GitHub (May 29, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

dify1.4.1
The agent cannot call the workflow tool normally when using it

Image

Image

✔️ Expected Behavior

Image

Actual Behavior

Image

Originally created by @1578411229 on GitHub (May 29, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce dify1.4.1 The agent cannot call the workflow tool normally when using it ![Image](https://github.com/user-attachments/assets/fd654ea4-9595-499b-ad35-410c9e889912) ![Image](https://github.com/user-attachments/assets/491b0c00-8561-4c88-8ebd-932e058412db) ### ✔️ Expected Behavior ![Image](https://github.com/user-attachments/assets/6fb1a51b-39e3-465e-a9a4-b0fac112554c) ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/f51c731d-a131-4fc0-aadf-60cfa16d46f4)
yindo closed this issue 2026-02-21 19:16:31 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 29, 2025):

The 401 Unauthorized error when your agent tries to call the workflow tool in Dify 1.4.1 (self-hosted, Docker) is most likely caused by missing or invalid authorization credentials, or by cross-domain (CORS) configuration issues.

Key things to check:

  1. Tool Authorization & Credentials:
    The agent workflow tool requires valid authorization, such as API keys or other credentials, to function. Make sure you have entered the correct credentials for the tool in your .env file or in the tool configuration interface. For some tools, you may need to manually edit the .env file and restart your Docker containers after updating credentials. See the relevant documentation for environment variable setup and credential requirements source.

  2. CORS and Domain Configuration:
    If you changed the domain or URL of your Dify instance, or if your frontend and backend are on different domains, you may encounter 401 errors due to cross-domain issues. Check your environment variables for:

    • CONSOLE_CORS_ALLOW_ORIGINS
    • WEB_API_CORS_ALLOW_ORIGINS

    By default, these are set to * (allow all), but if you have customized them, ensure they include the correct domains for both frontend and backend. More details are in the install FAQ source.

  3. Logs for Diagnosis:
    The Agent node generates detailed logs during execution, including information about authorization failures. Check these logs to see the exact error message and confirm whether the issue is with missing credentials, invalid tokens, or CORS source.

  4. Tool Authorization in UI:
    In the Dify UI, each tool's authorization status is tracked. If a tool is not authorized, you may see a "Not Authorized" or similar tooltip. Make sure you have completed any required authorization steps for the tool in the agent configuration source.

Next steps:

  • Double-check your tool credentials and .env file.
  • Restart your Docker containers after making changes.
  • Review your CORS/domain settings.
  • Examine the agent logs for more details on the failure.

If you continue to see 401 errors after these checks, please provide the relevant log output or more details about your environment and configuration.

To reply, just mention my name @dosu.


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

@dosubot[bot] commented on GitHub (May 29, 2025): <!-- Answer --> The 401 Unauthorized error when your agent tries to call the workflow tool in Dify 1.4.1 (self-hosted, Docker) is most likely caused by missing or invalid authorization credentials, or by cross-domain (CORS) configuration issues. **Key things to check:** 1. **Tool Authorization & Credentials:** The agent workflow tool requires valid authorization, such as API keys or other credentials, to function. Make sure you have entered the correct credentials for the tool in your `.env` file or in the tool configuration interface. For some tools, you may need to manually edit the `.env` file and restart your Docker containers after updating credentials. See the relevant documentation for environment variable setup and credential requirements [source](https://github.com/crazywoola/dify-docs-mintlify/blob/main/en/learn-more/use-cases/build-ai-sales-avatar.mdx). 2. **CORS and Domain Configuration:** If you changed the domain or URL of your Dify instance, or if your frontend and backend are on different domains, you may encounter 401 errors due to cross-domain issues. Check your environment variables for: - `CONSOLE_CORS_ALLOW_ORIGINS` - `WEB_API_CORS_ALLOW_ORIGINS` By default, these are set to `*` (allow all), but if you have customized them, ensure they include the correct domains for both frontend and backend. More details are in the install FAQ [source](https://github.com/crazywoola/dify-docs-mintlify/blob/main/en/learn-more/faq/install-faq.mdx). 3. **Logs for Diagnosis:** The Agent node generates detailed logs during execution, including information about authorization failures. Check these logs to see the exact error message and confirm whether the issue is with missing credentials, invalid tokens, or CORS [source](https://github.com/crazywoola/dify-docs-mintlify/blob/main/ja-jp/guides/workflow/node/agent.mdx). 4. **Tool Authorization in UI:** In the Dify UI, each tool's authorization status is tracked. If a tool is not authorized, you may see a "Not Authorized" or similar tooltip. Make sure you have completed any required authorization steps for the tool in the agent configuration [source](https://github.com/langgenius/dify/blob/main/web/app/components/app/configuration/config/agent/agent-tools/index.tsx). **Next steps:** - Double-check your tool credentials and `.env` file. - Restart your Docker containers after making changes. - Review your CORS/domain settings. - Examine the agent logs for more details on the failure. If you continue to see 401 errors after these checks, please provide the relevant log output or more details about your environment and configuration. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b56694ce-519c-4960-af42-fad7559fc224?feedback_type=other)</sup>&nbsp;&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/20405)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14286