I have a complex workflow that begins with a webhook. Within this webhook, users can select a “flavor” option. The only difference between these flavors is that they use the same workflow but require different system prompts and AI models. Changing the AI model is straightforward using an expression, but the system prompt is a large block of text.
Where should I store these system prompts, and how can I select the appropriate one based on the chosen flavor? Currently, I have about 10 AI agent nodes that I switch between depending on the selected flavor. each one has it is own System prompt
You could employ the Switch node + respective Set nodes per each branch to define the prompt, all then converging into the same AI Agent or whatever other pre-processing node you need.
The other, less obvious to other possible workflow maintainers tho, option would be a Code node that would cover prompt definition based on flavor.
Prompts could be stored as scalar values or read from an external source.
If the above addresses your question, please mark this post as a Solution.
Thank you for the answer, I am already employing a Switch node so after it I know all the info needed to go into the AI Agent Node. the only issue now I have from every switch case an AI agent node and the only difference is the system prompt. can you elaborate more about external source ?