Expression to get parameter data does not work

I am experimenting with node development a little and wanted to add better description text to my expanded “Execute Workflow” node. Composite nodes - #10 by FelixL
I wanted to use something like:

subtitle: '={{"Workflow: " + $parameter["workflowId"]["cachedResultName"]}}'

But that does not work.
Following ts code works in the ts portion of the node

console.log(this.getNodeParameter('workflowId.cachedResultName', 0))

As i copied most of my code from the n8n API node, i tried it directly with the original n8n API node with an expression in n8n:

The variable selector correctly shows the cachedResultName, like I would expect from the code in the node.
But even when it automatically generates the expression for “cachedResultName” it returns: [undefined]

Is there a workaround for that issue, or am I just overseeing something?

And an off-topic question, is it possible for a node to change its icon dynamically? Have not tried that yet, but that would be super cool ^^

Information on your n8n setup

  • n8n version: 0.225.2
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Win 11

EDIT: updated subtitle code (originally copied debugging code…)

Hey @FelixL,

What is the error you get when trying that? I am not sure why you would want to use console.log for the nodes subtitle it sounds like potentially a bad idea.

Dynamic icons is not something I have tried as it isn’t something we do with existing nodes so I wouldn’t expect it to work :slightly_smiling_face:

Hi @Jon, i just copied the false line, was trying to debug why it was not working -_-

Here is the correct line I’ve tried:

subtitle: '={{"Workflow: " + $parameter["workflowId"]["cachedResultName"]}}'

But that also does not work in the expression directly in n8n, even though the variable selector generates the expression like that.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.