Hi @saitor, welcome to the community! Perhaps the Execute Command node would be useful here? https://docs.n8n.io/nodes/n8n-nodes-base.executeCommand/
Just as an example, I created a workflow that runs a file called test.py
and proceeds based on the output of the python program. The python file contains the following code: print 'Yo'
.
Here’s the workflow:
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"command": "python test.py "
},
"name": "Execute Command",
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
450,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$node[\"Execute Command\"].json[\"stdout\"]}}",
"value2": "Yo"
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
650,
300
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "name",
"value": "n8n"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
850,
200
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "name",
"value": "nodemation"
}
]
},
"options": {}
},
"name": "Set1",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
850,
400
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Execute Command",
"type": "main",
"index": 0
}
]
]
},
"Execute Command": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
],
[
{
"node": "Set1",
"type": "main",
"index": 0
}
]
]
}
}
}