HTTP In to OpenRPA

Since you are working with python, i also want to mention you can “bypass” NodeRED and send message directly to OpenRPA from python.
If you pip install openiap then you can send a message to a robot by using the _id of the user that is logged into the robot using QueueMessage

So something similar to this

import openiap, asyncio
from openiap import Client
        
async def tmpqueue(client: openiap.Client, msg, payload: dict):
    print(("dummy"))
async def main():
    cli = openiap.Client()
    await cli.Signin()
    await cli.RegisterQueue("", tmpqueue) # Register a temp queue, for responses
    payload = {
        "command": "invoke",
        "workflowid": "5e0b52194f910e30ce9e3e49", # _id of the openrpa workflow run execute
        "data": {
            "payload": { # test must be added as a argument on the argument tab of the workflow in openrpa, as in/out
                "test": "find me"
            }
        }
    }
    # Send invoke command to the robot ( queuename is _id of the user the robot is running as )
    result = await cli.QueueMessage(queuename="5e0c8a75ea7ae0004e415e27", payload= payload, rpc=True)
    print(result["data"])
    cli.Close()
asyncio.run(main())

image

1 Like