Hi all. I wrote a Python script which sends data to nodeRED. I can see the data in debug mode but when I run the bot and use “write line” there’s no output. Window says bot ran successfully. Any way I can send the data to a bot?
I get the debug output when I run the python script.
@Velinkton i think that is how it already is, based on the screenshot.
But i think i could be more clear in my last post.
Think of a openrpa workflow as a function. The argument tab is the parameters of the function, and when you call that function from nodered, we map each property on msg.payload to the corresponding argument on the workflow. So in your case you need to add an argument called menuvalue … you can set it as in/out … inside your workflow do a writeline of menuvalue and then add an “assign” activity and change the value of menuvalue … then you can see the change in your debug node inside nodered )
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())