Workflow state is not persisted while pausing #21991

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

Originally created by @QuantumGhost on GitHub (Jan 30, 2026).

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

main

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Invoking a workflow containing HumanInput node with service API.

Minimal reproducible DSL:

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: human-input-workflow
  use_icon_as_answer_icon: false
dependencies: []
kind: app
version: 0.6.0
workflow:
  conversation_variables: []
  environment_variables: []
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      - .JPEG
      - .PNG
      - .GIF
      - .WEBP
      - .SVG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      - remote_url
      enabled: false
      fileUploadConfig:
        attachment_image_file_size_limit: 2
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        file_upload_limit: 10
        image_file_batch_limit: 10
        image_file_size_limit: 10
        single_chunk_attachment_limit: 10
        video_file_size_limit: 100
        workflow_file_upload_limit: 10
      image:
        enabled: false
        number_limits: 3
        transfer_methods:
        - local_file
        - remote_url
      number_limits: 3
    opening_statement: ''
    retriever_resource:
      enabled: true
    sensitive_word_avoidance:
      enabled: false
    speech_to_text:
      enabled: false
    suggested_questions: []
    suggested_questions_after_answer:
      enabled: false
    text_to_speech:
      enabled: false
      language: ''
      voice: ''
  graph:
    edges:
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: start
        targetType: human-input
      id: 1769414512627-source-1769414520563-target
      source: '1769414512627'
      sourceHandle: source
      target: '1769414520563'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: human-input
        targetType: end
      id: 1769414520563-action_1-1769414534043-target
      source: '1769414520563'
      sourceHandle: action_1
      target: '1769414534043'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInLoop: false
        sourceType: human-input
        targetType: end
      id: 1769414520563-action_2-1769414534043-target
      source: '1769414520563'
      sourceHandle: action_2
      target: '1769414534043'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInLoop: false
        sourceType: human-input
        targetType: end
      id: 1769414520563-__timeout-1769414534043-target
      source: '1769414520563'
      sourceHandle: __timeout
      target: '1769414534043'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        selected: false
        title: User Input
        type: start
        variables: []
      height: 73
      id: '1769414512627'
      position:
        x: 80
        y: 282
      positionAbsolute:
        x: 80
        y: 282
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        delivery_methods:
        - enabled: true
          id: 4da34e53-1cd7-4114-ab67-f81f70d136c0
          type: webapp
        - config:
            body: 'Run ID: {{#sys.workflow_id#}}


              URL:{{#url#}}'
            debug_mode: false
            recipients:
              items: []
              whole_workspace: true
            subject: Test HITL & Workflow Service API
          enabled: true
          id: ecd5b44e-1d40-4859-8991-285df9dc079a
          type: email
        form_content: ''
        inputs: []
        selected: true
        timeout: 3
        timeout_unit: day
        title: Human Input
        type: human-input
        user_actions:
        - button_style: default
          id: action_1
          title: Button Text 1
        - button_style: default
          id: action_2
          title: Button Text 2
      height: 220
      id: '1769414520563'
      position:
        x: 381
        y: 282
      positionAbsolute:
        x: 381
        y: 282
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        outputs:
        - value_selector:
          - '1769414520563'
          - __action_id
          value_type: string
          variable: __action_id
        selected: false
        title: Output
        type: end
      height: 88
      id: '1769414534043'
      position:
        x: 684
        y: 282
      positionAbsolute:
        x: 684
        y: 282
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    viewport:
      x: 149
      y: 61.5
      zoom: 1
  rag_pipeline_variables: []

✔️ Expected Behavior

The workflow execution state is persisted and can be resumed.

Actual Behavior

The execution state is not persisted. Workflow status is updated to PAUSED but cannot be resumed.

Originally created by @QuantumGhost on GitHub (Jan 30, 2026). ### 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 main ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce Invoking a workflow containing `HumanInput` node with service API. Minimal reproducible DSL: ```yaml app: description: '' icon: 🤖 icon_background: '#FFEAD5' mode: workflow name: human-input-workflow use_icon_as_answer_icon: false dependencies: [] kind: app version: 0.6.0 workflow: conversation_variables: [] environment_variables: [] features: file_upload: allowed_file_extensions: - .JPG - .JPEG - .PNG - .GIF - .WEBP - .SVG allowed_file_types: - image allowed_file_upload_methods: - local_file - remote_url enabled: false fileUploadConfig: attachment_image_file_size_limit: 2 audio_file_size_limit: 50 batch_count_limit: 5 file_size_limit: 15 file_upload_limit: 10 image_file_batch_limit: 10 image_file_size_limit: 10 single_chunk_attachment_limit: 10 video_file_size_limit: 100 workflow_file_upload_limit: 10 image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url number_limits: 3 opening_statement: '' retriever_resource: enabled: true sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: isInIteration: false isInLoop: false sourceType: start targetType: human-input id: 1769414512627-source-1769414520563-target source: '1769414512627' sourceHandle: source target: '1769414520563' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false isInLoop: false sourceType: human-input targetType: end id: 1769414520563-action_1-1769414534043-target source: '1769414520563' sourceHandle: action_1 target: '1769414534043' targetHandle: target type: custom zIndex: 0 - data: isInLoop: false sourceType: human-input targetType: end id: 1769414520563-action_2-1769414534043-target source: '1769414520563' sourceHandle: action_2 target: '1769414534043' targetHandle: target type: custom zIndex: 0 - data: isInLoop: false sourceType: human-input targetType: end id: 1769414520563-__timeout-1769414534043-target source: '1769414520563' sourceHandle: __timeout target: '1769414534043' targetHandle: target type: custom zIndex: 0 nodes: - data: selected: false title: User Input type: start variables: [] height: 73 id: '1769414512627' position: x: 80 y: 282 positionAbsolute: x: 80 y: 282 sourcePosition: right targetPosition: left type: custom width: 242 - data: delivery_methods: - enabled: true id: 4da34e53-1cd7-4114-ab67-f81f70d136c0 type: webapp - config: body: 'Run ID: {{#sys.workflow_id#}} URL:{{#url#}}' debug_mode: false recipients: items: [] whole_workspace: true subject: Test HITL & Workflow Service API enabled: true id: ecd5b44e-1d40-4859-8991-285df9dc079a type: email form_content: '' inputs: [] selected: true timeout: 3 timeout_unit: day title: Human Input type: human-input user_actions: - button_style: default id: action_1 title: Button Text 1 - button_style: default id: action_2 title: Button Text 2 height: 220 id: '1769414520563' position: x: 381 y: 282 positionAbsolute: x: 381 y: 282 selected: true sourcePosition: right targetPosition: left type: custom width: 242 - data: outputs: - value_selector: - '1769414520563' - __action_id value_type: string variable: __action_id selected: false title: Output type: end height: 88 id: '1769414534043' position: x: 684 y: 282 positionAbsolute: x: 684 y: 282 sourcePosition: right targetPosition: left type: custom width: 242 viewport: x: 149 y: 61.5 zoom: 1 rag_pipeline_variables: [] ``` ### ✔️ Expected Behavior The workflow execution state is persisted and can be resumed. ### ❌ Actual Behavior The execution state is not persisted. Workflow status is updated to `PAUSED` but cannot be resumed.
yindo added the 🐞 bug label 2026-02-21 20:15:11 -05:00
yindo closed this issue 2026-02-21 20:15:11 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2026):

The pause/resume mechanism for workflows with HumanInput nodes is implemented and production-ready in the main branch. When a workflow pauses (for example, at a HumanInput node), the engine serializes and persists the full runtime state—including variables, outputs, and node states—using a dedicated persistence layer and a WorkflowResumptionContext model. This allows workflows to remain paused for long periods and resume reliably after manual input or API calls [PR #27298] [PR #28122].

However, for pause/resume to work in self-hosted deployments, you must have a Celery worker listening on the workflow_based_app_execution queue. All resume flows (including Human-in-the-Loop) are processed through this queue. If you don't have a worker on this queue, paused workflows will remain stuck and cannot be resumed [issue #31632].

To resolve the issue:

  • Make sure your deployment (Docker Compose, Helm, etc.) includes a Celery worker with -Q workflow_based_app_execution.
  • Ensure your Redis PubSub configuration is correct (PUBSUB_REDIS_URL, PUBSUB_REDIS_CHANNEL_TYPE, and PUBSUB_REDIS_USE_CLUSTERS if scaling horizontally).

If your setup already includes these and the problem persists, check your logs for errors related to Celery, Redis, or workflow state persistence. If you need more help, sharing those logs or your deployment config will help pinpoint the issue.

References:

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 (Jan 30, 2026): <!-- Answer --> The pause/resume mechanism for workflows with HumanInput nodes is implemented and production-ready in the main branch. When a workflow pauses (for example, at a HumanInput node), the engine serializes and persists the full runtime state—including variables, outputs, and node states—using a dedicated persistence layer and a `WorkflowResumptionContext` model. This allows workflows to remain paused for long periods and resume reliably after manual input or API calls [[PR #27298](https://github.com/langgenius/dify/pull/27298)] [[PR #28122](https://github.com/langgenius/dify/pull/28122)]. However, for pause/resume to work in self-hosted deployments, you must have a Celery worker listening on the `workflow_based_app_execution` queue. All resume flows (including Human-in-the-Loop) are processed through this queue. If you don't have a worker on this queue, paused workflows will remain stuck and cannot be resumed [[issue #31632](https://github.com/langgenius/dify/issues/31632)]. To resolve the issue: - Make sure your deployment (Docker Compose, Helm, etc.) includes a Celery worker with `-Q workflow_based_app_execution`. - Ensure your Redis PubSub configuration is correct (`PUBSUB_REDIS_URL`, `PUBSUB_REDIS_CHANNEL_TYPE`, and `PUBSUB_REDIS_USE_CLUSTERS` if scaling horizontally). If your setup already includes these and the problem persists, check your logs for errors related to Celery, Redis, or workflow state persistence. If you need more help, sharing those logs or your deployment config will help pinpoint the issue. References: - [Pause/resume implementation and persistence layer](https://github.com/langgenius/dify/pull/27298) - [Celery queue requirement for workflow resume](https://github.com/langgenius/dify/issues/31632) - [HumanInputNode and HITL pause/resume mechanism](https://github.com/langgenius/dify/pull/30462) <!-- 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/64d2b093-e90b-4013-9644-943fb7a8bf55?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/64d2b093-e90b-4013-9644-943fb7a8bf55?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/64d2b093-e90b-4013-9644-943fb7a8bf55?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/64d2b093-e90b-4013-9644-943fb7a8bf55?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/64d2b093-e90b-4013-9644-943fb7a8bf55?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/64d2b093-e90b-4013-9644-943fb7a8bf55?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/64d2b093-e90b-4013-9644-943fb7a8bf55?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=The%20pause/resume%20mechanism%20for%20workflows%20with%20HumanInput%20nodes%20is%20implemented%20and%20production-ready%20in%20the%20main%20branch.%20When%20a%20workflow%20pauses%20%28for%20example%2C%20at%20a%20HumanInput%20node%29%2C%20the%20engine%20serializes%20and%20persists%20the%20full%20runtime%20state%E2%80%94including%20variables%2C%20outputs%2C%20and%20node%20states%E2%80%94using%20a%20dedicated%20persistence%20layer%20and%20a%20%60WorkflowResumptionContext%60%20model.%20This%20allows%20workflows%20to%20remain%20paused%20for%20long%20periods%20and%20resume%20reliably%20after%20manual%20input%20or%20API%20calls%20%5B%5BPR%20%2327298%5D%28https%3A//github.com/langgenius/dify/pull/27298%29%5D%20%5B%5BPR%20%2328122%5D%28https%3A//github.com/langgenius/dify/pull/28122%29%5D.%0A%0AHowever%2C%20for%20pause/resume%20to%20work%20in%20self-hosted%20deployments%2C%20you%20must%20have%20a%20Celery%20worker%20listening%20on%20the%20%60workflow_based_app_execution%60%20queue.%20All%20resume%20flows%20%28including%20Human-in-the-Loop%29%20are%20processed%20through%20this%20queue.%20If%20you%20don%27t%20have%20a%20worker%20on%20this%20queue%2C%20paused%20workflows%20will%20remain%20stuck%20and%20cannot%20be%20resumed%20%5B%5Bissue%20%2331632%5D%28https%3A//github.com/langgenius/dify/issues/31632%29%5D.%0A%0ATo%20resolve%20the%20issue%3A%0A-%20Make%20sure%20your%20deployment%20%28Docker%20Compose%2C%20Helm%2C%20etc.%29%20includes%20a%20Celery%20worker%20with%20%60-Q%20workflow_based_app_execution%60.%0A-%20Ensure%20your%20Redis%20PubSub%20configuration%20is%20correct%20%28%60PUBSUB_REDIS_URL%60%2C%20%60PUBSUB_REDIS_CHANNEL_TYPE%60%2C%20and%20%60PUBSUB_REDIS_USE_CLUSTERS%60%20if%20scaling%20horizontally%29.%0A%0AIf%20your%20setup%20already%20includes%20these%20and%20the%20problem%20persists%2C%20check%20your%20logs%20for%20errors%20related%20to%20Celery%2C%20Redis%2C%20or%20workflow%20state%20persistence.%20If%20you%20need%20more%20help%2C%20sharing%20those%20logs%20or%20your%20deployment%20config%20will%20help%20pinpoint%20the%20issue.%0A%0AReferences%3A%0A-%20%5BPause/resume%20implementation%20and%20persistence%20layer%5D%28https%3A//github.com/langgenius/dify/pull/27298%29%0A-%20%5BCelery%20queue%20requirement%20for%20workflow%20resume%5D%28https%3A//github.com/langgenius/dify/issues/31632%29%0A-%20%5BHumanInputNode%20and%20HITL%20pause/resume%20mechanism%5D%28https%3A//github.com/langgenius/dify/pull/30462%29)&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/31749)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21991