Planifiez, réalisez et analysez automatiquement les inventaires, suivez les écarts et générez des rapports pour optimiser la gestion des actifs de l’entreprise.
Planifiez, réalisez et analysez automatiquement les inventaires, suivez les écarts et générez des rapports pour optimiser la gestion des actifs de l’entreprise.
{
"meta": {
"instanceId": "84ba6d895254e080ac2b4916d987aa66b000f88d4d919a6b9c76848f9b8a7616",
"templateId": "2446"
},
"nodes": [
{
"id": "af0765f4-75b5-445c-80d7-51b0aa180fe5",
"name": "OpenAI Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
820,
620
],
"parameters": {
"model": "gpt-4o",
"options": {
"temperature": 0,
"responseFormat": "text"
}
},
"typeVersion": 1
},
{
"id": "497c534e-e117-4592-b76f-bef424a7fd5a",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1500,
400
],
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "5b358850-cbc3-4a8c-b2b8-12e3b7aa1e44",
"name": "calendarAgent",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
1060,
620
],
"parameters": {
"name": "calendarAgent",
"fields": {
"values": [
{
"name": "sessionId",
"stringValue": "={{ $json.sessionId }}"
},
{
"name": "prompt",
"stringValue": "={{ $json.chatInput }}"
}
]
},
"workflowId": {
"__rl": true,
"mode": "list",
"value": "yPCMz4zxB291oM31",
"cachedResultName": "Google Calendar Agent"
},
"description": "Call this workflow to do handle every request regarding calendar management.",
"responsePropertyName": "output"
},
"typeVersion": 1.2
},
{
"id": "8bcc4b27-59b9-4ce3-8525-34221c10f11a",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
460,
480
],
"webhookId": "96e410fe-ef91-4767-aa9a-bf95ba50f972",
"parameters": {
"public": true,
"options": {}
},
"typeVersion": 1.1
},
{
"id": "0aa8e0ff-7ed3-4fef-9b7c-f2caa8f85612",
"name": "taskAgent",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
1180,
620
],
"parameters": {
"name": "taskAgent",
"fields": {
"values": [
{
"name": "sessionId",
"stringValue": "={{ $json.sessionId }}"
},
{
"name": "prompt",
"stringValue": "={{ $json.chatInput }}"
}
]
},
"workflowId": {
"__rl": true,
"mode": "list",
"value": "ICTXOidW1oyJDYP7",
"cachedResultName": "Notion Task Agent"
},
"description": "Call this workflow to do handle every request regarding task management.",
"responsePropertyName": "output"
},
"typeVersion": 1.2
},
{
"id": "b46f4ed0-6de6-44ab-8b91-521b011d7869",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
940,
620
],
"parameters": {
"sessionKey": "={{ $json.sessionId }}",
"sessionIdType": "customKey",
"contextWindowLength": 15
},
"typeVersion": 1.2
},
{
"id": "e778c2bf-1681-418d-a434-d1a0cdeaa5d7",
"name": "Map Fields",
"type": "n8n-nodes-base.set",
"position": [
680,
320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f8c5a03f-ea21-4877-a71b-32e8b4dd30fb",
"name": "chatInput",
"type": "string",
"value": "={{ $json.body.prompt }}"
},
{
"id": "3d4fecc4-78a5-47ba-a239-5fdc9b224d82",
"name": "sessionId",
"type": "string",
"value": "={{ $json.body.sessionID }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c54d0fab-b25c-48fc-b027-dcdf78dd2b09",
"name": "Map Fields1",
"type": "n8n-nodes-base.set",
"position": [
680,
480
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "36f24729-17ae-4d69-961f-424a1797b42c",
"name": "chatInput",
"type": "string",
"value": "={{ $json.chatInput }}"
},
{
"id": "05ea359a-d82e-4917-9245-38016314ad10",
"name": "sessionId",
"type": "string",
"value": "={{ $json.sessionId }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "cefe6cc8-4a87-47c8-a518-c0bf06f96a2a",
"name": "Exclude Previews from Speech",
"type": "n8n-nodes-base.set",
"position": [
1280,
400
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "424b3c35-fd3d-4021-86e7-0d90529550b0",
"name": "response.text",
"type": "string",
"value": "={{ $json.output }}"
},
{
"id": "0cbe6fd9-3464-4bd1-b9c0-365548dc232a",
"name": "response.speech",
"type": "string",
"value": "={{ $if($json.output.search(/>\s/) > -1, $json.output.substring(0, $json.output.search(/>\s/)), $json.output) }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "815eb1a4-ef2d-430d-8884-217164214440",
"name": "Main Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
900,
400
],
"parameters": {
"text": "={{ $json.chatInput }}",
"options": {
"systemMessage": "=# Role:nYou are a helpful assistant. Your sole responsibility is to determine which tool to forward the original chat input to. Do not process, modify, or interpret the input or output in any way. Only route it to the correct tool.nn# Behavior:nBe clear, very concise, and accurate in tool routing. Do not modify, interpret, or analyze the incoming input or the tool's response. If the request is ambiguous, ask for clarification regarding tool selection only.nn# Command:nRoute all incoming requests to the available tools if they match their description.nCheck the memory to route ongoing conversations correctly u2014 only choose another tool if a new task has been requested or the context clearly has been switched. If the context has changed (e.g. you were asked to create a task before, but now the user asks to create an event), forget everything before the context switch.nnOnly call one tool at a time.nnDo not modify or alter the input before sending it to the tool or the output after receiving it from the tool. Simply pass through both input and output as they are.nn# Format:nPass every response of each tool in raw format to the output. Do not modify, interpret, or add any information at all."
},
"promptType": "define"
},
"typeVersion": 1.6
},
{
"id": "07b6d7e2-ab73-4f23-8dca-7c8b0309574c",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1520,
1100
],
"parameters": {
"model": "gpt-4o",
"options": {
"temperature": 0
}
},
"typeVersion": 1
},
{
"id": "882a93d8-886e-465d-9c81-cc8069abd281",
"name": "HTTP Request",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1760,
1100
],
"parameters": {
"url": "https://api.notion.com/v1/pages",
"method": "POST",
"jsonBody": "={n "parent": {n "database_id": "{{ $json.databaseID }}"n },n "properties": {n "Name": {n "title": [n {n "text": {n "content": "{title}"n }n }n ]n },n "Priority": {n "select": {n "name": "{priority}"n }n }n },n "children": [n {n "object": "block",n "type": "paragraph",n "paragraph": {n "rich_text": [n {n "type": "text",n "text": {n "content": "{description}"n }n }n ]n }n }n ]n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "Create a Task in Notion using a title, description and priority.",
"nodeCredentialType": "notionApi",
"placeholderDefinitions": {
"values": [
{
"name": "title",
"type": "string",
"description": "The name / title of the task."
},
{
"name": "description",
"type": "string",
"description": "The description of the task."
},
{
"name": "priority",
"type": "string",
"description": "The priority of the task. One of these values: "do first", "important", "urgent""
}
]
}
},
"typeVersion": 1.1
},
{
"id": "e19aad2c-132e-454f-a091-334f128b0636",
"name": "Settings",
"type": "n8n-nodes-base.set",
"position": [
1320,
880
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "3f65df4c-fae1-4da3-acfd-acf352a3f8d2",
"name": "sessionId",
"type": "string",
"value": "={{ $json.sessionId }}"
},
{
"id": "9745bdbd-fd97-46db-a742-6540f86dd43c",
"name": "chatInput",
"type": "string",
"value": "={{ $json.prompt }}"
},
{
"id": "5e757768-d780-4b11-a6e0-593b08f32cc3",
"name": "databaseID",
"type": "string",
"value": "92da2aa018ed4095afc0f1a0670f36e9"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "0fe6aa57-7a64-40f4-af2d-30f4286b8aee",
"name": "Format output",
"type": "n8n-nodes-base.set",
"position": [
1920,
880
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "934c387a-71a5-4549-a68a-312708368117",
"name": "output",
"type": "string",
"value": "=Please respond this to the user without modifications:nn{{ $json.output }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b2170997-5ebb-4261-92ce-70b33d68931f",
"name": "Notion Task Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1540,
880
],
"parameters": {
"options": {
"systemMessage": "=# Role:nYou are a helpful assistant. Your job is to create Tasks in Notion.nn# Behavior:nBe clear, very concise, efficient, and accurate in responses. If the request is ambiguous, ask for clarification.nn# Command:nYou create tasks in Notion. Each task consists of the mandatory fields title, description and priority. Priority is an enum value consisting of 'do first', 'important' and 'urgent'.nn# Ask questions:nIf required information is missing, ask the user about the missing information and only the missing ones. Ask priority as last.nnIf the user only describes the task within a few words, use that as the title. In that case, ask the user, if he wants to add a more detailed description. If he responds with "No", leave the description empty when creating the task.nOn the other hand if the user describes the task more detailed from the beginning, use that as the description and create a short meaningful title for that. nnIf you have all the required information, ask for approval, before creating the task. In that case, always return a draft, containing the title, description and priority.nn# Format:nThe output of the draft for approval should always be in markdown and in this format (placeholders in angle brackets):nnHere is the drafted task. Shall I create it?nn> **** n> ** n> n> nn# Responses:nAfter successfully created event, only respond with "Okay, done.""
}
},
"typeVersion": 1.6
},
{
"id": "a83fdec9-8c0e-45d0-8439-41c23440a21e",
"name": "Window Buffer Memory1",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1640,
1100
],
"parameters": {
"sessionKey": "={{ $json.sessionId }}-{{ $workflow.id }}",
"sessionIdType": "customKey",
"contextWindowLength": 15
},
"typeVersion": 1.2
},
{
"id": "80ae1a6f-5811-407a-a287-5150b8ecba22",
"name": "Get calendar availability",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
820,
1100
],
"parameters": {
"url": "https://www.googleapis.com/calendar/v3/freeBusy",
"method": "POST",
"jsonBody": "={n "timeMin": "{timeMin}",n "timeMax": "{timeMax}",n "timeZone": "{{ $json.timeZone }}",n "groupExpansionMax": 20,n "calendarExpansionMax": 10,n "items": [n {n "id": "{{ $json.calendarID }}"n }n ]n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "Call this tool to get the calendar availability for a particular period on the calendar. The tool may refer to availability as "Free" or "Busy". nnUse {timeMin} and {timeMax} to specify the window for the availability query. For example, to get availability for 25 July, 2024 the {timeMin} would be 2024-07-25T00:00:00+02:00 and {timeMax} would be 2024-07-26T00:00:00+02:00.nnIf the tool returns an empty response, it means that something went wrong. It does not mean that there is no availability.",
"nodeCredentialType": "googleCalendarOAuth2Api"
},
"typeVersion": 1
},
{
"id": "1d44a1eb-1b14-4ce8-b874-673db7be482c",
"name": "Book appointment",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
940,
1100
],
"parameters": {
"url": "=https://www.googleapis.com/calendar/v3/calendars/{{ $json.calendarID }}/events",
"method": "POST",
"jsonBody": "={n "summary": "{eventName}",n "start": {n "dateTime": "{startTime}",n "timeZone": "Europe/Berlin"n },n "end": {n "dateTime": "{endTime}",n "timeZone": "Europe/Berlin"n }n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "Call this tool to create an event in the calendar.",
"nodeCredentialType": "googleCalendarOAuth2Api",
"placeholderDefinitions": {
"values": [
{
"name": "eventName",
"description": "A short but precise title for the event."
},
{
"name": "startTime",
"description": "The start time of the event in Europe/Berlin timezone. For example, 2024-07-24T10:00:00+02:00"
},
{
"name": "endTime",
"description": "The end time of the event in Europe/Berlin timezone. It should always be 30 minutes after the startTime. "
}
]
}
},
"typeVersion": 1
},
{
"id": "d814abe2-fe6f-43ba-99b7-8380ed78dd26",
"name": "Google Calendar Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
660,
880
],
"parameters": {
"options": {
"systemMessage": "=# Role:nYou are a helpful assistant. Your job is to schedule Google Calendar Events.nn# Behavior:nBe clear, very concise, efficient, and accurate in responses. If the request is ambiguous, ask for clarification.nn# Command:nYou create Google Calendar events. Each event requires a title, date and time. The default duration - if not provided by the user - is 1 hour.nnBefore creating even showing a draft of the event, use the provided tool to check for the availibilty in the calendar. If there are any conflicts, tell the user about the timespans which are blocked, propose another time slot close by and ask the user if he would like to change the time to that.nn# Ask questions:nIf required information is missing, ask the user about the missing information and only the missing ones.nnIf you have all the required information, ask for approval, before creating the event. In that case, always return a draft, containing the title, date and time.nn# Format:nThe output of the draft for approval should always be in markdown and in this format (placeholders in angle brackets):nnHere is the event. Shall I create it?nn> **** n> n>