workflow-stop-design
OfficialSafely pause workflows with Redis-backed signal.
Authorlabring
Version1.0.0
Installs0
System Documentation
What problem does it solve?
此技能提供一种简单、鲁棒的方式,通过 Redis 的键存在性来控制工作流暂停,从而避免正在运行的任务造成资源浪费与状态不一致。通过设置一个 TTL 为 60 秒的停止标志键,确保键不会因为异常而长期存在;工作流完成后会主动清除该键以释放资源。
Core Features & Use Cases
- 设置停止标志: 使用 setAgentRuntimeStop 为指定 appId 与 chatId 设置停止信号,TTL 60 秒。
- 检查是否应该暂停: 使用 shouldWorkflowStop 根据 Redis 键是否存在判断工作流是否应当暂停。
- 清除停止信号: 使用 delAgentRuntimeStopSign 当工作流完成后清除信号,确保后续可继续运行。
- 等待完成: 使用 waitForWorkflowComplete 轮询检查停止标志是否被删除,在超时前等待信号解除。
- 鲁棒性设计: Redis 操作失败时降级为继续执行,避免阻塞工作流。
Quick Start
- 将暂停信号应用于指定 appId 与 chatId:调用 setAgentRuntimeStop({ appId: 'your_app_id', chatId: 'your_chat_id' })。
- 让工作流进入暂停状态:重复调用 waitForWorkflowComplete({ appId: 'your_app_id', chatId: 'your_chat_id' }),直到停止标志被删除。
- 工作流完成后清除停止信号:调用 delAgentRuntimeStopSign({ appId: 'your_app_id', chatId: 'your_chat_id' })。
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: workflow-stop-design Download link: https://github.com/labring/FastGPT/archive/main.zip#workflow-stop-design Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.