Describe the problem/error/question
I’ve adapted an AI workflow template, that passes a user’s query to a workflow tool when the answer isn’t known. That tool then responds asking the user to repeat their question and include their Email address so that a human can get in touch. This is working, but I’d like to avoid the user having to repeat the question by passing the full conversation history to the tool once the Email address has been supplied (this is to raise a support ticket.) However I can’t work out how to pass the chat history to the Tool; can anyone provide pointers?
What is the error message (if any)?
No error, I just need to refine the workflow
Please share your workflow
Share the output returned by the last node
{
"action": "saveContext",
"input": {
"input": "Respond to this query as though you don't know the answer. What's the square root of an orange? [email protected]",
"system_message": "You are a helpful and friendly assistant for students and staff at the Open College of the Arts. When asked questions you should refer to the provided Vector Store Tool context. When you can't answer from the context, or you're not confident of the answer, use the dont_know_tool. When you use the dont_know_tool, always respond with the message from the tool.",
"formatting_instructions": "IMPORTANT: Always call `format_final_response` to format your final response!"
},
"output": {
"input": "Respond to this query as though you don't know the answer. What's the square root of an orange? [email protected]",
"system_message": "You are a helpful and friendly assistant for students and staff at the Open College of the Arts. When asked questions you should refer to the provided Vector Store Tool context. When you can't answer from the context, or you're not confident of the answer, use the dont_know_tool. When you use the dont_know_tool, always respond with the message from the tool.",
"formatting_instructions": "IMPORTANT: Always call `format_final_response` to format your final response!",
"chat_history": [
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"HumanMessage"
],
"kwargs": {
"content": "Respond to this query as though you don't know the answer",
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"AIMessage"
],
"kwargs": {
"content": "I'm sorry, I don't know the answer. Please repeat your question and include your email address so I can request help.",
"tool_calls": [],
"invalid_tool_calls": [],
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"HumanMessage"
],
"kwargs": {
"content": "Respond to this query as though you don't know the answer. What's the square root of an apple?",
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"AIMessage"
],
"kwargs": {
"content": "I'm sorry, I don't know the answer. Please repeat your question and include your email address so I can request help.",
"tool_calls": [],
"invalid_tool_calls": [],
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"HumanMessage"
],
"kwargs": {
"content": "[email protected]",
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"AIMessage"
],
"kwargs": {
"content": "Thank you for getting in touch. I've raised a ticket for a human to help.",
"tool_calls": [],
"invalid_tool_calls": [],
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"HumanMessage"
],
"kwargs": {
"content": "Respond to this query as though you don't know the answer. What's the square root of an orange?",
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"AIMessage"
],
"kwargs": {
"content": "I'm sorry, I don't know the answer. Please repeat your question and include your email address so I can request help.",
"tool_calls": [],
"invalid_tool_calls": [],
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"HumanMessage"
],
"kwargs": {
"content": "Respond to this query as though you don't know the answer. What's the square root of an orange? [email protected]",
"additional_kwargs": {},
"response_metadata": {}
}
},
{
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"AIMessage"
],
"kwargs": {
"content": "Thank you for getting in touch. I've raised a ticket for a human to help.",
"tool_calls": [],
"invalid_tool_calls": [],
"additional_kwargs": {},
"response_metadata": {}
}
}
],
"output": "Thank you for getting in touch. I've raised a ticket for a human to help."
}
}
Information on your n8n setup
- n8n version: 1.62.3
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Ubuntu 22.04.4