dify icon indicating copy to clipboard operation
dify copied to clipboard

Chatflow Human Input form submission returns 404 "Form not found" in webapp: BACKSTAGE access token issued to the webapp surface on 1.19.0

Open optimist1990 opened this issue 2 weeks ago • 2 comments

Self Checks

  • [x] I have read the Contributing Guide and Language Policy.
  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [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, 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.19.0 (Docker self-hosted, upgraded from 1.17.1)

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Run a chatflow (advanced-chat mode, published as a web app) that pauses on a Human Input node with delivery methods webapp enabled.
  2. Trigger the workflow from the web app (published app page, nginx-served web:3000), and let it pause on the Human Input node. The form card renders with the action buttons.
  3. Click any action button on the form card.

✔️ Expected Behavior

The webapp submission is accepted and the workflow resumes, because the webapp surface should have been issued the STANDALONE_WEB_APP recipient token.

❌ Actual Behavior

POST /api/form/human_input/{token} returns 404 with body {"message": "Form not found"} and the UI shows a "Form not found" toast. The workflow run stays paused and the form stays waiting.

Suspected root cause / relation to existing work

This matches the exact failure mode fixed by #37556 ("the token emitter picked a recipient by global priority (BACKSTAGE > CONSOLE > WEBAPP), ignoring which surface would resume it"), where the resume endpoint rejects any token that is not STANDALONE_WEB_APP with a 404.

That fix was in the pre-1.18 Human Input implementation. #44864 (HITL IM integration, merged for 1.19.0) rewrote the recipient/delivery domain, and the behavior appears to have regressed: on 1.19.0 the webapp surface again receives the BACKSTAGE token (with a null account_id), so webapp submissions always 404. Console-side (debug preview) submission with the BACKSTAGE token appears to work as the workaround.

optimist1990 avatar Nov 17 '26 02:11 optimist1990

Hi @optimist1990! I'm Dosu and I'm helping the Dify team.

This matches #45753, and a fix was merged in #45827 on November 13, 2026. That PR specifically addresses published Web App runs receiving a BACKSTAGE token and then failing submission with 404.

One refinement to the suspected cause: #37556 addressed CLI/Service API token selection, but the Web App invocation mapping remained missing. The rejection introduced by #44644 exposed that mismatch in 1.19.0, so the evidence does not require attributing it to the #44864 rewrite. (#37556, #45827)

The current code explicitly maps InvokeFrom.WEB_APP to HumanInputSurface.WEB_APP, then filters token candidates to STANDALONE_WEB_APP before applying priority. This fixes the emitter rather than relying on the public endpoint accepting an internal token. [1] [2] [3]

For your Docker deployment, #45827 is the fix to track for release inclusion. I could confirm the merge, but not a released Docker version containing it, so I would not recommend a specific upgrade tag yet.

To reply, just mention @dosu.


Share context across your team and agents. Try Dosu.

Leave Feedback Learn about dify with Dosu

dosubot[bot] avatar Nov 17 '26 02:11 dosubot[bot]

Spot on analysis. PR #44864 refactored the delivery domain and dropped the caller surface context introduced in #37556, so the SSE stream defaults to emitting the BACKSTAGE recipient token rather than scoping to STANDALONE_WEB_APP. Because /api/form/human_input/<token> strictly validates token audience on public submissions, it triggers the 404 FormNotFoundError.

If you can't pin back to 1.18.3 while a patch PR is prepped, you can hot-patch the SSE form event generator in the API container to explicitly filter form.recipients for RecipientType.STANDALONE_WEB_APP when dispatching to webapp sessions.

grinem avatar Nov 19 '26 20:11 grinem