This plugin extends the @nocobase/plugin-workflow with an Endpoint Trigger and a Response Instruction.
It allows you to trigger workflows via HTTP requests and return custom responses directly to the caller.
- Endpoint Trigger: Execute workflows by calling a specific endpoint URL.
- Response Instruction: Control the HTTP response (body and status code) from the workflow.
- Go to Workflow in the Admin UI.
- Click Create Workflow.
- Set the Type to Endpoint. (if you don't see it, just docker restart the container)
- Give it a unique Title (e.g.,
My Public API). - Enable the workflow.
- Add an Endpoint node to your workflow.
- Configure the Title to match the workflow title you set above.
- (Optional) Configure the Method (GET, POST, PUT, DELETE).
there are only 2 way to set the response node: either hardcode it and use no variable or inject a single variable. so I suggest you use a JSON node or a JS node to create the json and then pass it to the response.
Use the following URL format:
/api/workflows.endpoint:execute?title=YourWorkflowTitle
- By default, endpoints are public (no authentication required).
- You can use the
x-roleheader to specify a role:
curl -X POST http://localhost:13000/api/workflows.endpoint.execute?title=MyPublicAPI \
-H "x-role: admin" \
-H "Content-Type: application/json" \
-d '{"name": "John"}'MIT