如何通过命令行或REST API执行Workfusion RPA业务流程?
Great questions! As someone who’s worked with WorkFusion RPA a fair bit, let’s break down your two queries clearly:
Absolutely, you can run your WorkFusion workflow via the command line—though it’s not a standalone .exe, but a packaged robot that uses WorkFusion’s runtime to execute. Here’s how to do it:
- First, package your project in the IDE: Go to
Project > Export Robot Package, pick a save location, and you’ll get a.zipfile containing your full workflow. - Ensure the WorkFusion RPA Runtime is installed (it comes included with RPA Express; if you’re running on a separate machine, you’ll need to install it there first).
- Open Command Prompt, navigate to the Runtime directory (default path is usually
C:\Program Files\WorkFusion\RPA Express\Runtime), then run this command:robotrunner.bat -package "C:\path\to\your\robot-package.zip" - If your workflow uses variables, you can pass them directly in the command like this:
robotrunner.bat -package "C:\path\to\your\robot-package.zip" -variables "inputPath=C:\data\file.csv,outputPath=C:\results"
Yes, you have two reliable options depending on your use case:
Option 1: Use WorkFusion Control Room’s built-in API
If you’re using the Control Room (ideal for managing and scaling workflows), you can trigger executions via its native REST API:
- First, deploy your workflow to the Control Room and register a robot to run it.
- Generate an API token from your Control Room user settings (go to
Profile > API Tokensto create one). - Send a
POSTrequest to the Control Room API endpoint:http://<control-room-ip>:<port>/api/v1/executions
The request body should include details like the robot ID and workflow parameters. Example JSON body:
Don’t forget to include your API token in the{ "robotId": "your-robot-uuid", "variables": { "inputParam": "value-from-external-app" } }Authorizationheader asBearer <your-token>.
Option 2: Add an HTTP Listener directly in your workflow
For a lightweight, direct approach without the Control Room, use the HTTP Listener component in the IDE:
- Drag the
HTTP Listenercomponent from the component library to the start of your workflow. - Configure it: Set a port (e.g., 8080), a path (e.g.,
/start-workflow), and choose the request method (GET or POST). - Add logic to parse incoming request parameters (if needed) using components like
Get HTTP Request Parameter, then connect it to your existing workflow steps. - To send a response back to the calling app, add an
HTTP Responsecomponent at the end of your workflow to return status codes or custom data. - Once you start the workflow, external apps can trigger it by sending an HTTP request to
http://<your-robot-machine-ip>:8080/start-workflow.
Hope that clears things up! Let me know if you hit any snags with specific steps.
内容的提问来源于stack exchange,提问作者Rahul

