when publishing workflow as a web app, how to run workflow immediately after opening and pass params through url #15952

Closed
opened 2026-02-21 19:24:05 -05:00 by yindo · 2 comments
Owner

Originally created by @Warnier-zhang on GitHub (Aug 6, 2025).

Description

for example, there is a workflow published at http://localhost/workflow/Wf2nBGYRofB5aK67 and the workflow accept a param name?

if i open http://localhost/workflow/Wf2nBGYRofB5aK67?name=dify, it would run automatically

Motivation

No response

Additional Context

No response

Originally created by @Warnier-zhang on GitHub (Aug 6, 2025). ### Description for example, there is a workflow published at **http://localhost/workflow/Wf2nBGYRofB5aK67** and the workflow accept a param **name**? if i open **http://localhost/workflow/Wf2nBGYRofB5aK67?name=dify**, it would run automatically ### Motivation _No response_ ### Additional Context _No response_
yindo added the 🌚 invalid label 2026-02-21 19:24:05 -05:00
yindo closed this issue 2026-02-21 19:24:06 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 6, 2025):

Hi @Warnier-zhang! I'm Dosu and I’m helping the dify team.

Dify does not natively support auto-running a workflow or passing input parameters via URL for workflow web apps. This feature is only available for chat flows, where parameters must be gzip-compressed, base64-encoded, and URI-encoded before being appended to the URL. For workflow web apps, input fields must be filled and the workflow started manually by the user—there is no built-in mechanism to map query parameters to workflow inputs or trigger execution on page load [source].

To achieve your goal, you would need to customize the frontend code: parse URL parameters, map them to the workflow input fields, and programmatically trigger the workflow run on page load. The relevant logic for workflow input and execution is in the React components handling the workflow web app UI, such as web/app/components/share/text-generation/index.tsx and run-once/index.tsx [source].

If you implement this, be sure to validate and sanitize any input from the URL to avoid security risks.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Aug 6, 2025): <!-- Greeting --> Hi @Warnier-zhang! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Dify does not natively support auto-running a workflow or passing input parameters via URL for workflow web apps. This feature is only available for chat flows, where parameters must be gzip-compressed, base64-encoded, and URI-encoded before being appended to the URL. For workflow web apps, input fields must be filled and the workflow started manually by the user—there is no built-in mechanism to map query parameters to workflow inputs or trigger execution on page load [[source](https://github.com/langgenius/dify/issues/21250)]. To achieve your goal, you would need to customize the frontend code: parse URL parameters, map them to the workflow input fields, and programmatically trigger the workflow run on page load. The relevant logic for workflow input and execution is in the React components handling the workflow web app UI, such as `web/app/components/share/text-generation/index.tsx` and `run-once/index.tsx` [[source](https://github.com/langgenius/dify/blob/f3c98a274bb214d96b0c484f094773f161ea112c/web/app/components/share/text-generation/index.tsx)]. If you implement this, be sure to validate and sanitize any input from the URL to avoid security risks. <!-- 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/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/18285a31-c052-4e92-a42f-29ef442b7e5f?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/23530)
Author
Owner

@crazywoola commented on GitHub (Aug 6, 2025):

This is only for refactor purpose, if you would like to ask a question, please head to Discussions.

@crazywoola commented on GitHub (Aug 6, 2025): This is only for refactor purpose, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15952