I have a workflow which creates another workflow with an ai agent. Everything works until the ai agents prompt settings are not set properly. I want that the ai agent gets its prompt from the first node(webhook), So it should be like in the picture. When I use this:
it sets the prompt type correctly but doesnt get the {{ $json.body.chatInput }} into the prompt type. Instead of “Prompt” I tried other things like:“text“ “chatInput“ etc. everything. its not working.
Anybody might have an idea? Highly appreciated! Thanks in advance
hey, yeah this is a common issue when you’re programmatically creating workflows. the problem is how n8n serializes the AI Agent node settings.
when you’re building the workflow JSON, the prompt field needs to be in the `parameters` object, not at the root level. also, the expression syntax changes depending on where it’s coming from.