Optimiser la gestion des échéances de prêts et crédits grâce à l’automatisation

Le suivi des prêts et crédits est stratégique pour la bonne santé financière de l’entreprise. L’automatisation permet de recevoir des rappels avant chaque échéance, d’archiver les confirmations de paiement et de suivre l’état d’avancement de chaque remboursement. Les alertes anticipent les besoins de refinancement ou les risques de défaut. Les tableaux de bord offrent une vue consolidée des encours, facilitant la planification de nouveaux investissements ou la négociation avec les partenaires bancaires. Ce système réduit le risque d’incident bancaire et optimise la gestion de la dette.

				
					{
  "meta": {
    "instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
  },
  "nodes": [
    {
      "id": "645799b0-7ddb-4acb-a95d-3b04eadff445",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1480,
        20
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e2923385-2f73-439c-9d5c-5a3c560993cb",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2040,
        420
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c24728f9-73b9-45f7-9c4e-aee872c59714",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3180,
        -80
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0bc19e46-4a65-45fb-9571-d1f00d204c63",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2060,
        -261
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8gccIjcuf3gvaoEr",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0c631234-125d-476b-b97a-2837d6a32f2b",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -272,
        -180
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "96c9931d-d286-42f8-9629-2641eaa368b9",
      "name": "Get Issue Comments",
      "type": "n8n-nodes-base.jira",
      "position": [
        748,
        -180
      ],
      "parameters": {
        "options": {},
        "issueKey": "={{ $json.key }}",
        "resource": "issueComment",
        "operation": "getAll"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "18a2770d-5240-4837-8837-4821f73ec560",
      "name": "Close Issue",
      "type": "n8n-nodes-base.jira",
      "position": [
        2660,
        -741
      ],
      "parameters": {
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "operation": "update",
        "updateFields": {
          "statusId": {
            "__rl": true,
            "mode": "list",
            "value": "31",
            "cachedResultName": "Done"
          }
        }
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "83e81448-26c7-4c29-a17a-409c53e05881",
      "name": "Send Reminder",
      "type": "n8n-nodes-base.jira",
      "position": [
        3500,
        -220
      ],
      "parameters": {
        "comment": "={{ $json.text }}n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5fed9245-4af9-4de7-b021-750d2ba39e63",
      "name": "Join Comments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        928,
        -180
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "34712dd3-0348-4709-8a68-07279242910c",
      "name": "Add Autoclose Message",
      "type": "n8n-nodes-base.jira",
      "position": [
        2460,
        -561
      ],
      "parameters": {
        "comment": "=Autoclosing due to inactivity. Please create a new ticket if you require additional support. Thank you!n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c43a3b66-838b-4970-a85f-dc0370437388",
      "name": "Ask For Feedback Message",
      "type": "n8n-nodes-base.jira",
      "position": [
        2460,
        -741
      ],
      "parameters": {
        "comment": "=[~accountid:{{ $('Get Issue Metadata').item.json.reporter_accountId }}]nnWe think the issue is resolved so we're autoclosing it. If you've been satisified with our service, please leave us a 5 start review here: [link](link/to/review_site)nnPlease feel free to create another ticket if you need further assistance.n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3223ce45-9e5e-471c-9015-75e9f28088e9",
      "name": "Simplify Thread For AI",
      "type": "n8n-nodes-base.set",
      "position": [
        1108,
        -180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f65c5971-c90d-47f2-823f-37fd03d8e9c7",
              "name": "thread",
              "type": "array",
              "value": "={{n$json.data.map(comment =&gt; {n  const { accountId, displayName } = comment.author;nn  const message = comment.body.content.map(item =&gt;n    `${item.contentn      .filter(c =&gt; c.text || c.content)n      .map(c =&gt; c.contentn        ? c.contentn            .filter(cc =&gt; c.text || c.content)n            .map(cc =&gt; cc.text)n            .join(' ')n        : c.textn      )}</${item.type}>`n  ).join('');n  return `${displayName} (accountId: ${accountId}) says: ${message}`;n})nn}}"
            },
            {
              "id": "7b98b2db-3417-472f-bea2-a7aebe30184c",
              "name": "topic",
              "type": "string",
              "value": "={{n[n  `title: ${$('Get Issue Metadata').item.json.title}`,n  `original message: ${$('Get Issue Metadata').item.json.description.replaceAll(/\n/g, ' ')}`,n  `reported by: ${$('Get Issue Metadata').item.json.reporter}`n].join('\n')n}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e6f91099-1fe6-4930-8dda-b19330edb599",
      "name": "Solution Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        2440,
        220
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0e71783b-3072-421a-852c-58940d0dd7cd",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.output.solution_found }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "696348a5-c955-47eb-ab44-f56652587944",
      "name": "Reply to Issue",
      "type": "n8n-nodes-base.jira",
      "position": [
        2760,
        220
      ],
      "parameters": {
        "comment": "=Hey there!n{{ $('KnowledgeBase Agent').item.json.output.response }}nWe'll close this issue now but feel free to create a new one if needed.n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4d4562c7-f5ed-44b8-9292-9c1a75d51173",
      "name": "Last Message is Not Bot",
      "type": "n8n-nodes-base.if",
      "position": [
        3000,
        -220
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6e07d5dc-01b2-4735-8fc1-983fc57dfaaf",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ !$('Simplify Thread For AI').item.json.thread.last().includes('this is an automated message') }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e1ca19da-c030-478b-a488-dcb08d9be97e",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2400,
        420
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{nt"type": "object",nt"properties": {ntt"solution_found": {nttt"type": "boolean"ntt},n        "short_summary_of_issue": {n          "type": "string"n        },ntt"response": {nttt"type": "string"ntt}nt}n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "596ef421-beb0-4523-a313-3f6ccd9e8f0c",
      "name": "Get Issue Metadata",
      "type": "n8n-nodes-base.set",
      "position": [
        568,
        -180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "200706ea-6936-48ae-a46c-38d6e2eff558",
              "name": "key",
              "type": "string",
              "value": "={{ $json.key }}"
            },
            {
              "id": "3e3584bf-dc5c-408a-896c-1660710860f6",
              "name": "title",
              "type": "string",
              "value": "={{ $json.fields.summary }}"
            },
            {
              "id": "e1d89014-5e07-4752-9e7c-ae8d4cba6f6e",
              "name": "url",
              "type": "string",
              "value": "={{n[n  'https:/',n  $json.self.extractDomain(),n    'browse',n    $json.keyn  ].join('/')n}}"
            },
            {
              "id": "df1cca88-1c57-475d-968e-999f6c25dba7",
              "name": "date",
              "type": "string",
              "value": "={{ DateTime.fromISO($json.fields.created).format('yyyy-MM-dd') }}"
            },
            {
              "id": "7fc9c625-e741-43bb-9223-b8024fc86cc7",
              "name": "reporter",
              "type": "string",
              "value": "={{ $json.fields.reporter.displayName }}"
            },
            {
              "id": "17bf06ae-fcad-4eb3-add8-11ac85e9a68e",
              "name": "reporter_url",
              "type": "string",
              "value": "={{n[n  'https:/',n  $json.fields.reporter.self.extractDomain(),n    'jira',n    'people',n    $json.fields.reporter.accountIdn  ].join('/')n}}"
            },
            {
              "id": "7624642f-f76b-41ec-b402-280b64d46400",
              "name": "reporter_accountId",
              "type": "string",
              "value": "={{ $json.fields.reporter.accountId }}"
            },
            {
              "id": "0fa1d73f-4e8b-435b-a78d-37e95c85c87c",
              "name": "description",
              "type": "string",
              "value": "={{ $json.fields.description }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "23bb0cf8-c682-416c-a809-e9ca6fc480ef",
      "name": "Notify Slack Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        2600,
        380
      ],
      "parameters": {
        "select": "channel",
        "blocksUi": "={{n{nt"blocks": [ntt{nttt"type": "section",nttt"text": {ntttt"type": "mrkdwn",ntttt"text": "Hey there ud83dudc4b\nI found a zombie ticket that no one has taken a look at yet."nttt}ntt},ntt{nttt"type": "section",nttt"text": {ntttt"type": "mrkdwn",ntttt"text": `*[${$('Get Issue Metadata').item.json.key}]  ${$('Get Issue Metadata').item.json.title}*\n${$('KnowledgeBase Agent').item.json.output.short_summary_of_issue}\nud83dudc64  ud83dudcc5 ${$('Get Issue Metadata').item.json.date} ud83dudd17 \n`nttt}ntt},ntt{nttt"type": "divider"ntt},ntt{nttt"type": "section",nttt"text": {ntttt"type": "mrkdwn",ntttt"text": "I couldn't find an answer in the knowledgebase so I've notified the user and closed the ticket. Thanks!"nttt}ntt}nt]n}n}}",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C07S0NQ04D7",
          "cachedResultName": "n8n-jira"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "VfK3js0YdqBdQLGP",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "21076f8f-8462-4a5a-8831-709a138639c5",
      "name": "Close Issue2",
      "type": "n8n-nodes-base.jira",
      "position": [
        2920,
        220
      ],
      "parameters": {
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "operation": "update",
        "updateFields": {
          "statusId": {
            "__rl": true,
            "mode": "list",
            "value": "31",
            "cachedResultName": "Done"
          }
        }
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "IH5V74q6PusewNjD",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6c9b30c5-d061-4b4d-b4fa-596ca0768297",
      "name": "Get List of Unresolved Long Lived Issues",
      "type": "n8n-nodes-base.jira",
      "position": [
        -72,
        -180
      ],
      "parameters": {
        "limit": 10,
        "options": {
          "jql": "status IN ("To Do", "In Progress") AND created &lt;= -7d&quot;
        },
        &quot;operation&quot;: &quot;getAll&quot;
      },
      &quot;credentials&quot;: {
        &quot;jiraSoftwareCloudApi&quot;: {
          &quot;id&quot;: &quot;IH5V74q6PusewNjD&quot;,
          &quot;name&quot;: &quot;Jira SW Cloud account&quot;
        }
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;1c6c2919-c48b-47bb-a975-f184bd9e95dd&quot;,
      &quot;name&quot;: &quot;Sticky Note1&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        -337.3183708039286,
        -425.6402206027777
      ],
      &quot;parameters&quot;: {
        &quot;color&quot;: 7,
        &quot;width&quot;: 640.6500163735489,
        &quot;height&quot;: 484.114789072283,
        &quot;content&quot;: &quot;## 1. Search For Unresolved Long-lived JIRA Issuesn[Learn more about the JIRA node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.jira)nnIn this demonstration, we&#039;ll define &quot;long-lived&quot; as any issue which is unresolved after 7 days. Adjust to fit your own criteria.nnWe&#039;ll also use the Execute Workflow node to run the issues separate in parallel. This is a performance optimisation and if not required, the alternative is to use a loop node instead.&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;f21d95a7-0cef-4110-a3b9-59c562b2ea24&quot;,
      &quot;name&quot;: &quot;Execute Workflow&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.executeWorkflow&quot;,
      &quot;position&quot;: [
        128,
        -180
      ],
      &quot;parameters&quot;: {
        &quot;mode&quot;: &quot;each&quot;,
        &quot;options&quot;: {},
        &quot;workflowId&quot;: {
          &quot;__rl&quot;: true,
          &quot;mode&quot;: &quot;id&quot;,
          &quot;value&quot;: &quot;={{ $workflow.id }}&quot;
        }
      },
      &quot;typeVersion&quot;: 1.1
    },
    {
      &quot;id&quot;: &quot;e9f9e6e6-c66d-4e50-b4d4-3931b8cf40c9&quot;,
      &quot;name&quot;: &quot;Execute Workflow Trigger&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.executeWorkflowTrigger&quot;,
      &quot;position&quot;: [
        388,
        -180
      ],
      &quot;parameters&quot;: {},
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;91b5e024-6141-47e8-99ff-9ac25df7df48&quot;,
      &quot;name&quot;: &quot;Sticky Note2&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        320,
        -353.43597793972225
      ],
      &quot;parameters&quot;: {
        &quot;color&quot;: 7,
        &quot;width&quot;: 956.5422324510927,
        &quot;height&quot;: 411.91054640922755,
        &quot;content&quot;: &quot;## 2. Retrieves and Combine JIRA Issue Commentsn[Learn more about the JIRA node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.jira)nnTo provide the necessary information for our AI agents, we&#039;ll fetch and combine all the issue&#039;s comments along with our issue. This gives a accurate history of the the issues progress (or lack thereof!).&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;9b545aa8-d2df-4500-8af0-ee55b0fcc736&quot;,
      &quot;name&quot;: &quot;Sticky Note3&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        1300,
        -381.8893508540474
      ],
      &quot;parameters&quot;: {
        &quot;color&quot;: 7,
        &quot;width&quot;: 653.0761795166852,
        &quot;height&quot;: 583.0290516595711,
        &quot;content&quot;: &quot;## 3. Classify the Current State of the Issuen[Learn more about the Text Classifier node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.text-classifier)nnToday&#039;s AI/LLMs are well suited for solving contextual problems like determining issue state. Here, we can use the text classifier node to analyse the issue as a whole to determine our next move. Almost like a really, really smart Switch node!nnThere are 3 branches we want to take: Check if a resolution was reached, blocked issues and auto-resolving when no team member has yet to respond.&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;abe0da8f-4107-4641-b992-1a31f71ce530&quot;,
      &quot;name&quot;: &quot;Sticky Note4&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        1980,
        -820
      ],
      &quot;parameters&quot;: {
        &quot;color&quot;: 7,
        &quot;width&quot;: 896.1509781357872,
        &quot;height&quot;: 726.4699654775604,
        &quot;content&quot;: &quot;## 4. Sentiment Analysis on Issue Resolutionn[Read more about the Sentiment Analysis node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.sentimentanalysis)nnThe Sentiment Analysis node is a convenient method of assessingncustomer satisfaction from resolved issues. Here, when resolutionnis detected as positive, we can ask use the opportunity toncapitalise of the favourable experience which in this example,nis to ask for a review. In the opposite vein, if the exchange hasnbeen negative, we can escalate in an attempt to improventhe situation before closing the ticket.nnAI can equip teams to provide unrivalled customer supportnwhich can differentiate themselves significantly againstnthe competition.&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;d9c97501-e2cf-4a7e-86cc-c295d69db939&quot;,
      &quot;name&quot;: &quot;Customer Satisfaction Agent&quot;,
      &quot;type&quot;: &quot;@n8n/n8n-nodes-langchain.sentimentAnalysis&quot;,
      &quot;position&quot;: [
        2060,
        -400
      ],
      &quot;parameters&quot;: {
        &quot;options&quot;: {},
        &quot;inputText&quot;: &quot;=issue:n{{ $(&#039;Simplify Thread For AI&#039;).item.json.topic }}nncomments:n{{ $(&#039;Simplify Thread For AI&#039;).item.json.thread.join(&#039;\n&#039;) }}&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;2829d591-8347-4683-be10-663872c08546&quot;,
      &quot;name&quot;: &quot;Sticky Note5&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        1980,
        -60
      ],
      &quot;parameters&quot;: {
        &quot;color&quot;: 7,
        &quot;width&quot;: 1120.504487917144,
        &quot;height&quot;: 675.5857025907994,
        &quot;content&quot;: &quot;## 5. Attempt to Resolve The Issue With KnowledgeBasen[Read more about the AI Agent node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)nnWhen the issue is unaddressed, we can attempt to resolve the issue automatically using AI. Here an AI agent can easily be deployed withnaccess to knowledge tools to research and generate solutions for the user. Since n8n v1.62.1, AI Tools Agents can attach nodes directly asntools providing a very easy way to linking documents to the LLM.nnHere, we use both the JIRA tool to search for similar issues and the notion tool to query for product pages. If a solution can be generated,nwe create a new comment with the solution and attach it to the issue. If not, then we can leave a simple message notifying the user that we could not do so. Finally, we close the issue as no further action can likely be taken in this case.&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;112c9fd3-c104-4a68-8e58-96a317fef854&quot;,
      &quot;name&quot;: &quot;KnowledgeBase Agent&quot;,
      &quot;type&quot;: &quot;@n8n/n8n-nodes-langchain.agent&quot;,
      &quot;position&quot;: [
        2060,
        220
      ],
      &quot;parameters&quot;: {
        &quot;text&quot;: &quot;=issue:n{{ $(&#039;Simplify Thread For AI&#039;).item.json.topic }}nncomments:n{{ $(&#039;Simplify Thread For AI&#039;).item.json.thread.join(&#039;\n&#039;) }}&quot;,
        &quot;options&quot;: {
          &quot;systemMessage&quot;: &quot;Help the user answer their question using the company&#039;s knowledgebase. Your answer must be based factually on documents retrieved from the knowledge. If no relevant information is found or the information is insufficent to answer the user&#039;s query, you must tell the user so and not mislead the user. If you don&#039;t know the answer, it is okay to say you don&#039;t know.&quot;
        },
        &quot;promptType&quot;: &quot;define&quot;,
        &quot;hasOutputParser&quot;: true
      },
      &quot;typeVersion&quot;: 1.6
    },
    {
      &quot;id&quot;: &quot;c27e0679-29a0-45d7-ada7-9727975b5069&quot;,
      &quot;name&quot;: &quot;Sticky Note6&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        2900,
        -421.245651256349
      ],
      &quot;parameters&quot;: {
        &quot;color&quot;: 7,
        &quot;width&quot;: 801.0347525891818,
        &quot;height&quot;: 507.581094640126,
        &quot;content&quot;: &quot;## 6. Notify for Unanswered Questions or Response Waitingn[Read more about the Basic LLM Chain node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/)nnIn this step, where signals indicate that the issue is not yet ready to be close, we can try to re-engage issue participants by summarize the conversation so far and sending a reminder comment for any pending actions that were requested. This action can help reduce the number of issues which linger for too long.&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;0a7da82e-789b-401c-80d0-de3ade51942c&quot;,
      &quot;name&quot;: &quot;Issue Reminder Agent&quot;,
      &quot;type&quot;: &quot;@n8n/n8n-nodes-langchain.chainLlm&quot;,
      &quot;position&quot;: [
        3180,
        -220
      ],
      &quot;parameters&quot;: {
        &quot;text&quot;: &quot;=issue:n{{ $(&#039;Simplify Thread For AI&#039;).item.json.topic }}nncomments:n{{ $(&#039;Simplify Thread For AI&#039;).item.json.thread }}&quot;,
        &quot;messages&quot;: {
          &quot;messageValues&quot;: [
            {
              &quot;message&quot;: &quot;=The user has a pending issue and some time has passed since the last update. Analyse the last message in this thread and generate a short reminder message to add to the issue comments which summarizes and reiterates what pending action or information is required. Return only the message.&quot;
            }
          ]
        },
        &quot;promptType&quot;: &quot;define&quot;
      },
      &quot;typeVersion&quot;: 1.4
    },
    {
      &quot;id&quot;: &quot;2847136e-b95b-4906-89af-ceb180abb9b0&quot;,
      &quot;name&quot;: &quot;Sticky Note&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.stickyNote&quot;,
      &quot;position&quot;: [
        -820,
        -560
      ],
      &quot;parameters&quot;: {
        &quot;width&quot;: 454.99286536248565,
        &quot;height&quot;: 619.151728428442,
        &quot;content&quot;: &quot;## Try It Out!nn### This n8n template is designed to assist and improve customer support team member capacity by automating the resolution of long-lived and forgotten JIRA issues.nn* Schedule Trigger runs daily to check for long-lived unresolved issues and imports them into the workflow.n* Each Issue is handled as a separate subworkflow by using an execute workflow node. This allows parallel processing.n* A report is generated from the issue using its comment history allowing the issue to be classified by AI - determining the state and progress of the issue.n* If determined to be resolved, sentiment analysis is performed to track customer satisfaction. If negative, a slack message is sent to escalate, otherwise the issue is closed automatically.n* If no response has been initiated, an AI agent will attempt to search and resolve the issue itself using similar resolved issues or from the notion database. If a solution is found, it is posted to the issue and closed.n* If the issue is blocked and waiting for responses, then a reminder message is added.nn### Need Help?nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!&quot;
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;9edb0847-5dcf-4357-a1d4-537a126e277b&quot;,
      &quot;name&quot;: &quot;Find Simlar Issues&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.jiraTool&quot;,
      &quot;position&quot;: [
        2160,
        420
      ],
      &quot;parameters&quot;: {
        &quot;limit&quot;: 4,
        &quot;options&quot;: {
          &quot;jql&quot;: &quot;=text ~ &quot;{{ $fromAI(&#039;title&#039;, &#039;the title of the current issue&#039;, &#039;string&#039;, &#039;&#039;) }}&quot; AND status IN (&quot;In Progress&quot;, &quot;Done&quot;)&quot;
        },
        &quot;operation&quot;: &quot;getAll&quot;,
        &quot;descriptionType&quot;: &quot;manual&quot;,
        &quot;toolDescription&quot;: &quot;Call this tool to search for similar issues in JIRA.&quot;
      },
      &quot;credentials&quot;: {
        &quot;jiraSoftwareCloudApi&quot;: {
          &quot;id&quot;: &quot;IH5V74q6PusewNjD&quot;,
          &quot;name&quot;: &quot;Jira SW Cloud account&quot;
        }
      },
      &quot;typeVersion&quot;: 1
    },
    {
      &quot;id&quot;: &quot;573c1b75-35ae-40f0-aa6e-c1372f83569b&quot;,
      &quot;name&quot;: &quot;Query KnowledgeBase&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.notionTool&quot;,
      &quot;position&quot;: [
        2280,
        420
      ],
      &quot;parameters&quot;: {
        &quot;text&quot;: &quot;={{ $fromAI(&#039;search_terms&#039;, &#039;relevant terms to search for information on the current issue&#039;, &#039;string&#039;, &#039;&#039;) }}&quot;,
        &quot;limit&quot;: 4,
        &quot;options&quot;: {},
        &quot;operation&quot;: &quot;search&quot;,
        &quot;descriptionType&quot;: &quot;manual&quot;,
        &quot;toolDescription&quot;: &quot;Search the knowledgebase for information relevant to the issue.&quot;
      },
      &quot;credentials&quot;: {
        &quot;notionApi&quot;: {
          &quot;id&quot;: &quot;iHBHe7ypzz4mZExM&quot;,
          &quot;name&quot;: &quot;Notion account&quot;
        }
      },
      &quot;typeVersion&quot;: 2.2
    },
    {
      &quot;id&quot;: &quot;1274f6ff-16d9-4d86-b75a-59755390a07c&quot;,
      &quot;name&quot;: &quot;Report Unhappy Resolution&quot;,
      &quot;type&quot;: &quot;n8n-nodes-base.slack&quot;,
      &quot;position&quot;: [
        2660,
        -400
      ],
      &quot;parameters&quot;: {
        &quot;text&quot;: &quot;=&quot;,
        &quot;select&quot;: &quot;channel&quot;,
        &quot;blocksUi&quot;: &quot;={{n{nt&quot;blocks&quot;: [ntt{nttt&quot;type&quot;: &quot;section&quot;,nttt&quot;text&quot;: {ntttt&quot;type&quot;: &quot;mrkdwn&quot;,ntttt&quot;text&quot;: &quot;Hey there ud83dudc4b\nI found a unclosed ticket which was resolved but thread overall has a negative sentiment score. Please address or close the ticket.&quot;nttt}ntt},ntt{nttt&quot;type&quot;: &quot;section&quot;,nttt&quot;text&quot;: {ntttt&quot;type&quot;: &quot;mrkdwn&quot;,ntttt&quot;text&quot;: `*[${$(&#039;Get Issue Metadata&#039;).item.json.key}]  ${$(&#039;Get Issue Metadata&#039;).item.json.title}*\n${$(&#039;KnowledgeBase Agent&#039;).item.json.output.short_summary_of_issue}\nud83dudc64  ud83dudcc5 ${$('Get Issue Metadata').item.json.date} ud83dudd17 \n`nttt}ntt},ntt{nttt"type": "divider"ntt},ntt{nttt"type": "section",nttt"text": {ntttt"type": "mrkdwn",ntttt"text": "Thanks!"nttt}ntt}nt]n}n}}",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C07S0NQ04D7",
          "cachedResultName": "n8n-jira"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "VfK3js0YdqBdQLGP",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3226d576-c3ae-444a-b0c5-ac797d25dd2e",
      "name": "Classify Current Issue State",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        1480,
        -140
      ],
      "parameters": {
        "options": {},
        "inputText": "=issue:n{{ $('Simplify Thread For AI').item.json.topic }}nncomments:n{{ $('Simplify Thread For AI').item.json.thread.join('\n') || 'There are no comments' }}",
        "categories": {
          "categories": [
            {
              "category": "resolved",
              "description": "There are human comments and a resolution was found and/or accepted"
            },
            {
              "category": "pending more information",
              "description": "There are human comments but no resolution has been reached yet"
            },
            {
              "category": "still waiting",
              "description": "Reporter is still waiting on a response. Ignoring automated messages, there are no comments."
            }
          ]
        }
      },
      "executeOnce": false,
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Join Comments": {
      "main": [
        [
          {
            "node": "Simplify Thread For AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply to Issue": {
      "main": [
        [
          {
            "node": "Close Issue2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Solution Found?": {
      "main": [
        [
          {
            "node": "Reply to Issue",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Slack Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get List of Unresolved Long Lived Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Current Issue State",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Find Simlar Issues": {
      "ai_tool": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Issue Comments": {
      "main": [
        [
          {
            "node": "Join Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Issue Metadata": {
      "main": [
        [
          {
            "node": "Get Issue Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Issue Reminder Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Customer Satisfaction Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "KnowledgeBase Agent": {
      "main": [
        [
          {
            "node": "Solution Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query KnowledgeBase": {
      "ai_tool": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Issue Reminder Agent": {
      "main": [
        [
          {
            "node": "Send Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Slack Channel": {
      "main": [
        [
          {
            "node": "Reply to Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Autoclose Message": {
      "main": [
        [
          {
            "node": "Close Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simplify Thread For AI": {
      "main": [
        [
          {
            "node": "Classify Current Issue State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Last Message is Not Bot": {
      "main": [
        [
          {
            "node": "Issue Reminder Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask For Feedback Message": {
      "main": [
        [
          {
            "node": "Close Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Get Issue Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Customer Satisfaction Agent": {
      "main": [
        [
          {
            "node": "Ask For Feedback Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Autoclose Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Report Unhappy Resolution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Current Issue State": {
      "main": [
        [
          {
            "node": "Customer Satisfaction Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Last Message is Not Bot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List of Unresolved Long Lived Issues": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}