Issue in "Execute Workflow" node

Hi dear friends

I try to use “Execute workflow” node to use one of my workflow in another. I think I should use “database source” to see other workflows but unfortunately I see below issue in “workflow” item:

  • There was a problem loading the parameter options from server: “401 - “Authorization is required!””

Could anyone please help me?

Best regards;

That has probably to do with the security-fix. I will remove the workflow selection and then require that people type in the workflow-id manually. In the meantime, you can do the same by simply setting the parameter to an expression and then set the workflow-id as such. It will still display you the error message but it will work anyway.

I’m so sorry I can’t fix it by my own can you please give an example or
Do you have some time to fix security please?

Sorry do not understand. I already wrote exactly what has to be done. But can write it down again step by step if it helps:

  1. Left click on the cogs icon on the very right side of the field “Workflow ID:”
  2. In the appearing menu select “Add Expression”
  3. You will then see the Expression-Editor
  4. In it use as expression simply the workflow-ID. So if it is 12 you write in the field simply 12 not more and not less

That is it.

It then probably still displays the message that it can not load the data but it should execute just fine.

Can anyone please explain me why when my workflow run a “Execute Workflow” node it run that workflow but show below error?

ERROR: Cannot read property 'data' of undefined

```
TypeError: Cannot read property 'data' of undefined
    at Object.executeWorkflow (/usr/local/lib/node_modules/n8n/dist/src/WorkflowExecuteAdditionalData.js:225:27)
    at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ExecuteWorkflow.node.js:161:30)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:370:47
```

Can you share your workflow to test? (by select all node, copy and paste to post)

In fact it happen on any workflow like this:

{
  "name": "",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "workflowId": "27"
      },
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {}
}

in this workflow I get below error:

ERROR: Cannot read property 'toString' of undefined

```
TypeError: Cannot read property 'toString' of undefined
    at Object.contains (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/If.node.js:223:50)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/If.node.js:259:94)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:570:37)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:370:62
```

I’ve tried and put Workflow ID but has this error:

@mooghermez That means that something tries to access the property data on something which does not exist or that you call toString on something that does not exist. The following should for example return the same error:

const a = {};
a.b.data;
a.b.toString();

In this case does a not have the property b which means that b is undefined. If you then try to access data on it or call .toString() you will see an error message like you do.

In your case it seems to happen in the IF-Node which makes me believe that one of the values you reference in there returns undefined. So please check them.

I came across this thread because I had the same error below.

ERROR: Cannot read property 'data' of undefined

If it helps anyone else, I got this on a Jira trigger because I put the wrong domain into the Jira server credentials. So, untested credentials are something to check.

1 Like