ClickUp node creates an empty task - JSON.parse expression fails silently

Hi everyone,

I'm building my first AI Agent workflow and I'm facing a very strange issue on the final step. I'm really close, but completely stuck!

My goal is simple: An AI Agent talks to a user and outputs a JSON string with the collected lead data. The next node, ClickUp, should create a new task with this data.

The Problem: The workflow runs successfully (all green nodes!), and a task IS created in ClickUp. However, the task is created with empty fields. The static text from my expression (like "**Empresa:**") is written correctly, but the dynamic part{{ … }}seems to evaluate to an empty string.

I'm using this expression to get the lead's name: {{ JSON.parse($json.output).json.dados.nome_lead }}

This seems to be a silent failure in the expression engine. I've already tried: - Using an Edit Fields node to parse the JSON first (it returned null). - Double-checking the data path, which seems correct based on the AI Agent's output.

I'm attaching a few screenshots showing the AI Agent's successful JSON output, and the final empty task created in ClickUp.

Is this a known bug, or is there a better way to reliably parse a JSON string from a previous node for the ClickUp fields?

Thank you so much for any help!



hello @Relitore

That’s because the JSON.parse function fails as you have improper JSON.

You should enable the option “Require specific output format” and specify the JSON schema to output

1 Like

Another option is to clean and parse the output after defining the agent’s output. You can use a Set or Code node to convert the output into a real JSON object. For example, in a Code node:

const raw = $json.output;
// Extract only the valid portion of the JSON
const match = raw.match(/\{[\s\S]*\}/);
if (!match) {
throw new Error("Could not extract valid JSON");
}
const parsed = JSON.parse(match[0]);
return [{ json: parsed }];

Then, in ClickUp, access the data directly.
After that, you can use simple expressions like:

{{ $json.dados.name_lead }}
{{ $json.dados.name_company }}

And they’ll work correctly because you’re no longer trying to JSON.parse(…) a string with double quotes and escaped newlines.