{
  "name": "گالری ۹: پیگیری جلسه (یادداشت، اقدام‌ها، تأیید، ارسال)",
  "nodes": [
    {
      "parameters": {
        "content": "## پیگیری پس از جلسه\n۱) جلسه در تقویم تمام شد\n۲) یادداشت جلسه از Google Docs (پیوند در توضیح رویداد)\n۳) خلاصه و اقدام‌ها با مالک و مهلت\n۴) پیش‌نویس برای برگزارکننده؛ ارسال فقط پس از تأیید\n۵) ارسال به شرکت‌کنندگان و ثبت اقدام‌ها در Sheets\n\n⚠️ نمونه آموزشی loOkiYar؛ غیرفعال. گره‌های بنفش (سنجاق‌دار) داده نمایشی ساختگی دارند و در اجرای دستی به سرویس واقعی وصل نمی‌شوند.",
        "height": 290,
        "width": 500,
        "color": 4
      },
      "id": "95efa247-edf8-5f16-9c95-966f23b310f0",
      "name": "یادداشت 1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        -420
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "value": 10,
              "unit": "minutes"
            }
          ]
        },
        "calendarId": {
          "__rl": true,
          "mode": "id",
          "value": "me@example.com"
        },
        "triggerOn": "eventEnded",
        "options": {
          "matchTerm": "#پیگیری"
        }
      },
      "id": "e58704e4-e12c-5acf-8080-80ad44f51373",
      "name": "جلسه تمام شد",
      "type": "n8n-nodes-base.googleCalendarTrigger",
      "typeVersion": 1,
      "position": [
        0,
        100
      ],
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "0491059a394554db",
          "name": "Google Calendar account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "fd5779ef-f23e-560d-8be7-5b108a4bac1f",
              "leftValue": "={{ $json.description || '' }}",
              "rightValue": "docs\\.google\\.com/document/d/",
              "operator": {
                "type": "string",
                "operation": "regex"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "889001a5-739f-5ba4-a89a-d52f6b57b291",
      "name": "یادداشت دارد؟",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        220,
        100
      ]
    },
    {
      "parameters": {
        "operation": "get",
        "documentURL": "={{ $json.description.match(/https:\\/\\/docs\\.google\\.com\\/document\\/d\\/[\\w-]+/)[0] }}",
        "simple": true
      },
      "id": "b22415c9-20e0-5c0e-aafb-dc3dce76e9cd",
      "name": "خواندن یادداشت جلسه",
      "type": "n8n-nodes-base.googleDocs",
      "typeVersion": 2,
      "position": [
        440,
        100
      ],
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "e02d6d0080d9585b",
          "name": "Google Docs account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=جلسه: {{ $('جلسه تمام شد').item.json.summary }}\nشرکت‌کنندگان: {{ ($('جلسه تمام شد').item.json.attendees || []).map(a => a.email).join(', ') }}\nیادداشت:\n{{ ($json.content || '').slice(0, 8000) }}",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "type": "SystemMessagePromptTemplate",
              "message": "از یادداشت جلسه خلاصه فارسی ۳ تا ۵ خطی و فهرست اقدام‌ها بساز. هر اقدام: کار، مالک (ایمیل از شرکت‌کنندگان یا «نامشخص»)، مهلت (YYYY-MM-DD یا خالی). چیزی که در یادداشت نیست اضافه نکن."
            }
          ]
        }
      },
      "id": "9053ebbf-b3df-595a-ab80-5b6023c548b3",
      "name": "خلاصه و اقدام‌ها",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.9,
      "position": [
        660,
        100
      ]
    },
    {
      "parameters": {
        "model": "openai/gpt-5-mini",
        "options": {
          "temperature": 0.2
        }
      },
      "id": "bd04f01f-f918-539a-b0b0-b8ae0ad8fd44",
      "name": "مدل (OpenRouter)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        600,
        340
      ],
      "credentials": {
        "openRouterApi": {
          "id": "fce14e07dac85574",
          "name": "OpenRouter account"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "fromJson",
        "jsonSchemaExample": "{\n  \"summary\": \"خلاصه\",\n  \"actions\": [\n    {\n      \"task\": \"کار\",\n      \"owner\": \"a@example.com\",\n      \"due\": \"2026-10-28\"\n    }\n  ]\n}"
      },
      "id": "8ae12826-7dd9-5a1e-ba45-8bf3d94ad112",
      "name": "قالب خروجی",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        780,
        340
      ]
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "sendTo": "={{ $('جلسه تمام شد').item.json.organizer.email }}",
        "subject": "=تأیید پیگیری: {{ $('جلسه تمام شد').item.json.summary }}",
        "message": "={{ $json.output.summary }}\n\nاقدام‌ها:\n{{ $json.output.actions.map(a => '- ' + a.task + ' | ' + a.owner + ' | ' + (a.due || '-')).join('\\n') }}",
        "responseType": "approval",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "ارسال شود",
            "disapproveLabel": "ارسال نشود"
          }
        },
        "options": {
          "limitWaitTime": {
            "values": {
              "limitType": "afterTimeInterval",
              "resumeAmount": 24,
              "resumeUnit": "hours"
            }
          }
        }
      },
      "id": "6b9a1a63-1acf-58cf-87e2-63c6dc8e6ca1",
      "name": "تأیید برگزارکننده",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        900,
        100
      ],
      "credentials": {
        "gmailOAuth2": {
          "id": "e6161cc65c9b5504",
          "name": "Gmail account"
        }
      },
      "webhookId": "7a0e1f20-2b3c-4d5e-8f60-000000000909"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "7d6eee7f-8a90-58e7-8458-596defdac879",
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "50d4a873-71e1-51d3-8af9-edddb2f73acc",
      "name": "تأیید شد؟",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1140,
        100
      ]
    },
    {
      "parameters": {
        "operation": "send",
        "sendTo": "={{ ($('جلسه تمام شد').item.json.attendees || []).map(a => a.email).join(',') }}",
        "subject": "=پیگیری جلسه: {{ $('جلسه تمام شد').item.json.summary }}",
        "emailType": "text",
        "message": "={{ $('خلاصه و اقدام‌ها').item.json.output.summary }}\n\nاقدام‌ها:\n{{ $('خلاصه و اقدام‌ها').item.json.output.actions.map(a => '- ' + a.task + ' | ' + a.owner + ' | ' + (a.due || '-')).join('\\n') }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "f1efdd2b-2285-5648-b3ba-fababa6c9a7a",
      "name": "ارسال به شرکت‌کنندگان",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        1380,
        0
      ],
      "credentials": {
        "gmailOAuth2": {
          "id": "e6161cc65c9b5504",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.actions",
        "options": {}
      },
      "id": "bbc731de-e4b6-5405-8874-77a5e5dd6de2",
      "name": "یک ردیف برای هر اقدام",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1380,
        200
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "REPLACE_WITH_SPREADSHEET_ID"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Actions"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {}
        },
        "options": {}
      },
      "id": "565307c2-0fac-5cf9-aeca-d464b30ed05b",
      "name": "ثبت اقدام‌ها",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1600,
        200
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "6fd5b108914d5fc7",
          "name": "Google Sheets account"
        }
      }
    }
  ],
  "connections": {
    "مدل (OpenRouter)": {
      "ai_languageModel": [
        [
          {
            "node": "خلاصه و اقدام‌ها",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "قالب خروجی": {
      "ai_outputParser": [
        [
          {
            "node": "خلاصه و اقدام‌ها",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "جلسه تمام شد": {
      "main": [
        [
          {
            "node": "یادداشت دارد؟",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "یادداشت دارد؟": {
      "main": [
        [
          {
            "node": "خواندن یادداشت جلسه",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "خواندن یادداشت جلسه": {
      "main": [
        [
          {
            "node": "خلاصه و اقدام‌ها",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "خلاصه و اقدام‌ها": {
      "main": [
        [
          {
            "node": "تأیید برگزارکننده",
            "type": "main",
            "index": 0
          },
          {
            "node": "یک ردیف برای هر اقدام",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "تأیید برگزارکننده": {
      "main": [
        [
          {
            "node": "تأیید شد؟",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "تأیید شد؟": {
      "main": [
        [
          {
            "node": "ارسال به شرکت‌کنندگان",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "یک ردیف برای هر اقدام": {
      "main": [
        [
          {
            "node": "ثبت اقدام‌ها",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "id": "LkyGal09MeetFollow",
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "lookiyar-academy-demo"
  },
  "tags": [
    {
      "name": "loOkiYar Academy"
    },
    {
      "name": "gallery"
    }
  ],
  "pinData": {
    "جلسه تمام شد": [
      {
        "json": {
          "id": "demo-ev-1",
          "summary": "برنامه فروش پاییز #پیگیری",
          "organizer": {
            "email": "manager@example.com"
          },
          "attendees": [
            {
              "email": "manager@example.com"
            },
            {
              "email": "sales@example.com"
            },
            {
              "email": "ops@example.com"
            }
          ],
          "description": "یادداشت: https://docs.google.com/document/d/DEMO-doc-id-123/edit",
          "_demo": "داده نمایشی ساختگی"
        }
      }
    ],
    "خواندن یادداشت جلسه": [
      {
        "json": {
          "documentId": "DEMO-doc-id-123",
          "content": "تصمیم: تخفیف ۱۰٪ برای کتاب‌های کودک از ۱ آبان. sales@example.com فهرست را تا ۲۸ مهر می‌فرستد. ops@example.com موجودی انبار را تا ۳۰ مهر بررسی می‌کند.",
          "_demo": "داده نمایشی ساختگی"
        }
      }
    ],
    "خلاصه و اقدام‌ها": [
      {
        "json": {
          "output": {
            "summary": "تخفیف ۱۰٪ کتاب‌های کودک از ۱ آبان تصویب شد. فهرست و موجودی پیش از شروع آماده می‌شود.",
            "actions": [
              {
                "task": "ارسال فهرست کتاب‌های تخفیف",
                "owner": "sales@example.com",
                "due": "2026-10-20"
              },
              {
                "task": "بررسی موجودی انبار",
                "owner": "ops@example.com",
                "due": "2026-10-22"
              }
            ]
          },
          "_demo": "داده نمایشی ساختگی"
        }
      }
    ],
    "تأیید برگزارکننده": [
      {
        "json": {
          "data": {
            "approved": true
          },
          "_demo": "داده نمایشی ساختگی"
        }
      }
    ],
    "ارسال به شرکت‌کنندگان": [
      {
        "json": {
          "id": "demo-sent-follow",
          "labelIds": [
            "SENT"
          ],
          "_demo": "داده نمایشی ساختگی"
        }
      }
    ],
    "ثبت اقدام‌ها": [
      {
        "json": {
          "task": "ارسال فهرست کتاب‌های تخفیف",
          "_demo": "داده نمایشی ساختگی"
        }
      },
      {
        "json": {
          "task": "بررسی موجودی انبار",
          "_demo": "داده نمایشی ساختگی"
        }
      }
    ]
  }
}