Dify Human-in-the-Loop: Approve AI Actions in Slack or Teams

Dify Human-in-the-Loop: Approve AI Actions in Slack or Teams

The question every team asks before letting an AI workflow do real work is the same: what happens when it's wrong? Sending the email, issuing the refund, publishing the post. Some steps should wait for a person.

Dify has had a Human Input node for a while. Dify 1.20, released on November 18, 2026, makes it far more practical: approval requests now go to people in Slack, Microsoft Teams and other chat tools, or by email, and they can approve right there. Here's how it works, where to put approvals, and what a self-hosted install needs for it to run.

What's New in 1.20

The release calls it "New HITL" (human in the loop), and it's on by default. From the release notes:

  • Approvals where people already are. Review requests go out by email or through an IM platform: Slack, Microsoft Teams, Feishu/Lark, DingTalk or WeCom.
  • Shared Contacts. Sync your chat directory and pick approvers from a shared list, instead of typing addresses into every node. Workflows can also address whoever started the run, or use one-time and dynamic email recipients.
  • Approve in a card or a form. Recipients can decide directly in a chat card where the platform supports it, or open a standalone form. Their identity is checked with a Dify login or email verification.
  • Context in the message. Templates can pull workflow variables into the notification, so the approver sees what the AI drafted without opening Dify.
  • Delivery tracking. You can send test notifications and inspect delivery records when a request doesn't arrive.

Existing Human Input nodes keep working. Moving them to the new version is opt-in, so you can migrate one workflow at a time.

Where to Put the Approval

The node is only useful if it sits in the right place. A simple rule: put a person in front of anything that leaves your system or can't be undone. In practice:

  • Before sending. The AI drafts a customer reply or a newsletter, and a human approves it in Slack before it goes out.
  • Before money moves. A support agent workflow proposes a refund, and a team lead confirms it.
  • Before writing to a system of record. Updating a CRM, closing a ticket, changing data in production.
  • When the model is unsure. Route only the low-confidence cases to a person, and let the confident ones through.

Put the important context in the message template: the customer, the amount, the AI's proposed text. An approver who has to click through to understand a request will start approving without reading.

One setting to know: HUMAN_INPUT_GLOBAL_TIMEOUT_SECONDS caps how long a workflow can sit paused waiting for someone. The default is 604,800 seconds, which is seven days.

What Self-Hosters Need to Set Up

This is the part that trips people up. Chat platforms deliver button clicks back to Dify through a webhook, so your Dify API has to be reachable from the internet. The release notes list four requirements:

  1. A public HTTPS address. Set TRIGGER_URL to the public HTTPS origin of your API. Dify uses it to generate each channel's callback URL, which you then paste into the Slack or Teams app configuration.
  2. The callback route. Your reverse proxy must forward /callbacks/human-input/v2/im/ to the API service (api:5001 in Docker Compose), keeping the path, the raw body and the provider's signature headers intact. The bundled nginx template already has this rule. A custom proxy needs it added.
  3. Two new worker queues. human_input_delivery and human_input_contact_sync. The default Docker worker already listens to both. If you set a custom queue list, add them, or approvals will never be sent.
  4. The feature flag. NEXT_PUBLIC_ENABLE_HITL_IM is now true by default. If you change it, restart the web container and reload the page.

Upgrading to 1.20 Safely

The upgrade guide has two changes that can catch a Docker Compose install out:

  • shared.env is no longer loaded. If you kept settings in docker/envs/core-services/shared.env, rename it to api-worker.env (or merge it into an existing one) before recreating containers. Otherwise those settings silently disappear.
  • A plain restart doesn't reload environment files. Apply changes with docker compose up -d.

Back up your database, vector store, uploaded files, plugin and agent storage, secrets and environment files first. Upgrade all Dify components together with matching 1.20.0 images, and keep SECRET_KEY unchanged. Coming from a version older than 1.19, follow the 1.19 guide first.

cd dify/docker
docker compose pull
docker compose up -d
docker compose logs -f api worker

If you send traces to Langfuse, 1.20 is also the version you want: Langfuse Cloud retired its legacy ingestion endpoint on November 16, and the release notes say older Dify versions can no longer deliver traces to it.

Running It on Elestio

Dify on Elestio starts at $16/month for the VM, with automated backups, SSL and updates included. Your instance already has a public HTTPS address, which is the main requirement for chat callbacks. Check that TRIGGER_URL points to it, and test a notification from the delivery records before you rely on it. For a busy production instance, try the upgrade on a Clone first, or let Elestio AI DevOps run it.

Troubleshooting

Approval messages never arrive. Check the delivery records in Dify first. If nothing was sent, a custom worker queue list is probably missing human_input_delivery.

The message arrives, but clicking Approve does nothing. The callback isn't reaching Dify. Check that TRIGGER_URL is your public HTTPS address, that the callback URL in your Slack or Teams app matches, and that your proxy forwards /callbacks/human-input/v2/im/ with headers and body unchanged.

Approvers in Contacts are missing. The directory sync runs on the human_input_contact_sync queue. Make sure a worker listens to it.

Settings vanished after the upgrade. They were in shared.env, which 1.20 ignores. Move them to api-worker.env and run docker compose up -d.

Workflows stay paused for days. Nobody responded before the timeout. Shorten HUMAN_INPUT_GLOBAL_TIMEOUT_SECONDS, or add a backup approver.

Thanks for reading ❤️ See you in the next one 👋