diff --git a/workflows/Generate LinkedIn Activity Reports via Slack Commands with GPT-4.1 and Email-11052/generate_linkedin_activity_reports_via_slack_commands_with_gpt-4.1_and_email.json b/workflows/Generate LinkedIn Activity Reports via Slack Commands with GPT-4.1 and Email-11052/generate_linkedin_activity_reports_via_slack_commands_with_gpt-4.1_and_email.json
new file mode 100644
index 000000000..d1cdc8b1e
--- /dev/null
+++ b/workflows/Generate LinkedIn Activity Reports via Slack Commands with GPT-4.1 and Email-11052/generate_linkedin_activity_reports_via_slack_commands_with_gpt-4.1_and_email.json
@@ -0,0 +1 @@
+{"id":"nBuvaxvgtOYI2xmk","meta":{"instanceId":"4e839a74f9cee9cae404b83e2a9088ce8b38f21e009880813cc56e5bb8aa4410","templateCredsSetupCompleted":true},"name":"2025 Nov - Slack Slash command - check-linkedin - for publication","tags":[{"id":"1XLW1DVao1oAC5iT","name":"Customer Success","createdAt":"2025-11-15T17:21:00.676Z","updatedAt":"2025-11-15T17:21:00.676Z"},{"id":"1qjph8VqWHRhXnlO","name":"Published","createdAt":"2025-11-15T18:14:39.908Z","updatedAt":"2025-11-15T18:14:39.908Z"},{"id":"6OaASw2bkjvGJYfM","name":"Experimentation","createdAt":"2025-11-15T18:16:11.694Z","updatedAt":"2025-11-15T18:16:11.694Z"},{"id":"rapjVlcQ0SoPnEXg","name":"AI","createdAt":"2025-11-15T18:14:48.492Z","updatedAt":"2025-11-15T18:14:48.492Z"}],"nodes":[{"id":"95f47a65-415c-4915-a9b0-fc272958edb1","name":"Webhook","type":"n8n-nodes-base.webhook","position":[0,0],"webhookId":"c865214a-6ad9-425c-94fc-6dd45634ca14","parameters":{"path":"path-placeholder-to-be-replaced-by-your-webhook","options":{},"httpMethod":"POST"},"typeVersion":2.1},{"id":"e9e68ae9-d835-4580-a73f-b11c66aac32b","name":"Aggregate","type":"n8n-nodes-base.aggregate","position":[1872,-96],"parameters":{"options":{},"fieldsToAggregate":{"fieldToAggregate":[{"fieldToAggregate":"posted_at.date"},{"fieldToAggregate":"text"}]}},"typeVersion":1},{"id":"c8643766-8325-495e-8d2c-a02312585c64","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[2272,112],"parameters":{"schemaType":"manual","inputSchema":"{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"title\": \"LinkedInPostsAnalysis\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\n \"latest_post_date\",\n \"most_recent_posts_summary\",\n \"posting_frequency\",\n \"top_topics\",\n \"recent_highlights\",\n \"data_quality\",\n \"notes\"\n ],\n \"properties\": {\n \"latest_post_date\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"Exact date of the most recent post, YYYY-MM-DD.\"\n },\n \"most_recent_posts_summary\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"2–4 sentence overview of the latest posts.\"\n },\n \"posting_frequency\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\n \"average_days_between_posts\",\n \"cadence_label\",\n \"posts_per_month_estimate\"\n ],\n \"properties\": {\n \"average_days_between_posts\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"cadence_label\": {\n \"type\": \"string\",\n \"enum\": [\n \"~multiple per week\",\n \"~weekly\",\n \"~biweekly\",\n \"~monthly\",\n \"~every 1–2 months\",\n \"~sporadic\"\n ]\n },\n \"posts_per_month_estimate\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n },\n \"top_topics\": {\n \"type\": \"array\",\n \"minItems\": 3,\n \"maxItems\": 3,\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"topic\", \"keywords\", \"rationale\"],\n \"properties\": {\n \"topic\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"keywords\": {\n \"type\": \"array\",\n \"minItems\": 2,\n \"maxItems\": 6,\n \"items\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n },\n \"rationale\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n }\n }\n },\n \"recent_highlights\": {\n \"type\": \"array\",\n \"minItems\": 2,\n \"maxItems\": 5,\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"date\", \"summary\", \"why_it_matters\"],\n \"properties\": {\n \"date\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"summary\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"why_it_matters\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n }\n }\n },\n \"data_quality\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"num_posts_detected\", \"num_dates_used\", \"date_range\"],\n \"properties\": {\n \"num_posts_detected\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"num_dates_used\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"date_range\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"start\", \"end\"],\n \"properties\": {\n \"start\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"end\": {\n \"type\": \"string\",\n \"format\": \"date\"\n }\n }\n }\n }\n },\n \"notes\": {\n \"type\": \"string\",\n \"description\": \"Assumptions, ambiguities, or caveats; empty string if none.\"\n }\n }\n}"},"typeVersion":1.3},{"id":"be2accab-b963-4aed-9280-76d427e93597","name":"Summer McBriefing","type":"@n8n/n8n-nodes-langchain.agent","position":[2080,-96],"parameters":{"text":"=Dates:\n{{ $json.date }}\n\nPosts: \n{{ $json.text }}","options":{"systemMessage":"You are an analytical assistant that receives:\n1) A list of dates for a single person’s recent LinkedIn posts, and\n2) One aggregated text block containing the corresponding posts with the most recent first.\n\nYour job is to return a concise, factual analysis with:\n- Latest post exact date\n- Brief summary of the received posts\n- Average posting frequency (numeric average days between posts, a cadence label, and a posts-per-month estimate)\n- Exactly three main topics (with keywords and a one-line rationale each)\n- A few recent highlights (date + why it matters)\n- Data quality stats and any notes\n\nRules:\n- Use only provided dates/text; no outside knowledge.\n- Normalize dates to YYYY-MM-DD. If times exist, ignore time-of-day.\n- Frequency: sort dates desc, compute gaps between consecutive dates, average the gaps. If <3 dates, compute with what’s available and note the limitation.\n- Cadence labels:\n ≤5 → \"~multiple per week\"\n 6–10 → \"~weekly\"\n 11–20 → \"~biweekly\"\n 21–45 → \"~monthly\"\n 46–90 → \"~every 1–2 months\"\n >90 → \"~sporadic\"\n- Topics: detect recurring themes; exactly 3 topics, each with 2–6 keywords and a one-line rationale.\n- Highlights: focus on last 3–5 posts (by date), each with date + significance.\n- If parsing is uncertain, state assumptions in \"notes\".\n\nOutput:\n- Return **ONLY** valid JSON matching the provided JSON Schema. No prose, no extra fields, no nulls. "},"promptType":"define","hasOutputParser":true},"typeVersion":3},{"id":"853a0068-09e8-4368-a735-a1e149549fc2","name":"HTML","type":"n8n-nodes-base.html","position":[2528,-96],"parameters":{"html":"\n\n
\n \n \n Profile Activity Brief\n \n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n | \n Latest Post\n {{ $json.output.latest_post_date }}\n | \n | \n \n Cadence\n {{ $json.output.posting_frequency.cadence_label }}\n | \n | \n \n Est. Monthly\n {{ $json.output.posting_frequency.posts_per_month_estimate }}\n | \n \n \n\n \n \n Top Focus Areas\n \n {{ $json.output.top_topics[0].topic }}\n {{ $json.output.top_topics[1].topic }}\n \n\n \n Recent Activity Summary\n \n {{ $json.output.most_recent_posts_summary }}\n \n\n \n Detailed Analysis\n \n \n \n {{ $json.output.top_topics[0].topic }}\n \n {{ $json.output.top_topics[0].rationale }}\n \n \n Keywords: \n \n {{ $json.output.top_topics[0].keywords }}\n \n \n\n \n \n {{ $json.output.top_topics[1].topic }}\n \n {{ $json.output.top_topics[1].rationale }}\n \n \n Keywords: \n {{ $json.output.top_topics[1].keywords }}\n \n \n\n | \n \n\n \n \n \n \n\n \n \n\n | \n
\n
\n\n\n"},"typeVersion":1.2},{"id":"af48e025-998b-4711-aa79-dd2241234a25","name":"Send report via Email","type":"n8n-nodes-base.gmail","position":[2736,-96],"webhookId":"978b61c3-edd2-455f-b949-22bf03a47f83","parameters":{"sendTo":"admin@example.com","message":"={{ $json.html }}","options":{},"subject":"=Recent LinkedIn Activity about {{ $('Get Linkedin Profile URL').item.json.personName }}"},"credentials":{"gmailOAuth2":{"id":"3IbPKCEy8B41xC1R","name":"Gmail account 3"}},"typeVersion":2.1},{"id":"1a5ff79c-1fe3-4df6-bd1e-2a4c0057c531","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","position":[2960,-112],"parameters":{"width":320,"height":144,"content":"## Questions or Feedback?\n\n📧 emir.belkahia@gmail.com \n💼 [linkedin.com/in/emirbelkahia](https://www.linkedin.com/in/emirbelkahia/)"},"typeVersion":1},{"id":"38325b74-a6ad-4113-a296-4de8de4462dc","name":"Tell on slack that no full name was found","type":"n8n-nodes-base.slack","position":[640,336],"webhookId":"eb02a706-eddd-4eed-9369-e11abf98c983","parameters":{"text":"={{ $json.body.text }} is not a full name. Please send a full name to get information.","select":"channel","channelId":{"__rl":true,"mode":"id","value":"={{ $json.body.channel_id }}"},"otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"PajGUCHvdipnfMt5","name":"Slack account"}},"typeVersion":2.3},{"id":"78626cb3-6788-42c2-9eba-bea75a2fc638","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[544,288],"parameters":{"color":3,"width":304,"height":320,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Error handling\nNo full name found in the slack command."},"typeVersion":1},{"id":"399b976a-3c5a-4f6f-a79f-b6fb356dd61f","name":"GPT 4.1-mini for classification","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[160,192],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini"},"options":{},"responsesApiEnabled":false},"credentials":{"openAiApi":{"id":"DIbcbQDS2wPTd9JM","name":"OpenAi account 3"}},"typeVersion":1.3},{"id":"fdcd4e6b-6e08-466c-9c06-d8d8517bb50b","name":"Do we have a full name ?","type":"@n8n/n8n-nodes-langchain.textClassifier","position":[208,0],"parameters":{"options":{},"inputText":"={{ $json.body.text }}","categories":{"categories":[{"category":"full-name","description":"The input text is a full name of a person"},{"category":"not-full-name","description":"The input text is not a full name of a person"}]}},"typeVersion":1.1},{"id":"95d18f4f-c8ee-43ba-88a9-527829a23061","name":"GPT 4.1-mini to extract firstName + lastName","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[640,96],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini"},"options":{},"builtInTools":{}},"credentials":{"openAiApi":{"id":"DIbcbQDS2wPTd9JM","name":"OpenAi account 3"}},"typeVersion":1.3},{"id":"cc26d2f5-4377-4f78-8f7b-13cae8edeedb","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-960,-288],"parameters":{"width":880,"height":832,"content":"# Slack Slash Command: LinkedIn Profile Recent Activity Summary\n- Run `/check-linkedin [firstName lastName]` in Slack to get an AI-powered brief on someone's LinkedIn activity.\n- Get instant context before outreach or meetings: recent posts, posting patterns, key topics, and engagement insights delivered straight to your inbox. No manual scrolling through profiles needed.\n\n## How it works\n- Type `/check-linkedin` followed by a person's first and last name in any Slack channel\n- Workflow extracts the name and searches LinkedIn via Apify\n- Fetches profile data and recent posts (up to 20)\n- AI analyzes posting frequency, top topics, and recent highlights\n- Structured summary generated via GPT 4.1 with posting cadence and engagement patterns\n- Formatted HTML report sent to your email with profile link and actionable insights\n\n## Setup steps\n- Create a Slack App with `/check-linkedin` slash command via Slack API console\n- Set the slash command Request URL to your n8n webhook endpoint\n- Connect credentials: Slack (chat:write, commands), Apify, Open AI, Gmail\n- Configure two Apify actors: LinkedIn Profile Lookup and LinkedIn Post Scraper\n- Update email recipient in \"Send report via Email\" node\n- Set your Slack workspace ID in error handling nodes\n\n## Customization\n- Name detection: The workflow expects a full name (ideally \"First Last\") format. For LinkedIn URLs or handles, add a conditional branch to parse differently.\n- Post limit: Currently fetches 20 recent posts. Adjust the limit parameter in \"Get recent posts\" node for more/less context.\n- Analysis depth: Modify the JSON schema in \"Structured Output Parser\" to add fields like company mentions, sentiment, or engagement metrics.\n- Cost control:\n - ApiFy actors have per-run costs. \n - The output size can be heavy depending on your parameters, so check it carefully to avoid consuming too many summarization tokens in the following OpenAI node."},"typeVersion":1},{"id":"0d1bb4d7-213e-4978-bc30-eb54dfdcaa4b","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-32,-336],"parameters":{"color":7,"width":912,"height":1008,"content":"## Slack Intake & Command Parsing\nFrom /check-linkedin trigger to the point where you extract a clear First Name and a clear Last Name"},"typeVersion":1},{"id":"a5380069-f6e2-45c8-9054-9f82982c75a4","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[944,-352],"parameters":{"color":7,"width":816,"height":496,"content":"## Data Gathering via ApiFy\nThe four ApiFy nodes responsible for fetching LinkedIn data:\n- We get the profile URL from the First Name and Last Name\n- Then we scrap the recent posts of this profile URL\n\n\n💰 This zone is cost sensitive and dependent on the ApiFy actors that you select 💰"},"typeVersion":1},{"id":"f2439c0b-f6dc-4d35-829d-ee0946c78002","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1824,-352],"parameters":{"color":7,"width":592,"height":768,"content":"## Summarization & Intelligence Layer\nConsolidate the raw data and generate a clean, human-readable summary.\n- Merge JSON\n- GPT 4.1 (LLM summarization)\n- Formatter to get a consistent output format\n\n💰 Summarization via GPT 4.1 per-call cost 💰\n"},"typeVersion":1},{"id":"a967607c-de2b-4dce-9571-2cb98d48f4ae","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[2480,-352],"parameters":{"color":7,"width":416,"height":768,"content":"## HTML Output & Response via Email\nFormat in HTML and send the result back via email to the requester."},"typeVersion":1},{"id":"69c0d193-2864-45a0-b053-d9ebccea2561","name":"Extract firstName and lastName","type":"@n8n/n8n-nodes-langchain.informationExtractor","position":[560,-96],"parameters":{"text":"={{ $json.body.text }}","options":{},"attributes":{"attributes":[{"name":"firstName","required":true,"description":"First Name of the person"},{"name":"lastName","required":true,"description":"Last Name of the person"}]}},"typeVersion":1.2},{"id":"eeae4a59-1f6a-4227-9329-f15d42dbefa5","name":"Get Linkedin Profile URL","type":"@apify/n8n-nodes-apify.apify","position":[1200,-96],"parameters":{"offset":{},"resource":"Datasets","datasetId":"={{ $json.defaultDatasetId }}"},"credentials":{"apifyApi":{"id":"5UtrVw2KKdiQDN3s","name":"Apify account"}},"typeVersion":1},{"id":"b1e5322d-e8c2-43da-b58a-d300a4615968","name":"Find Linkedin Profile","type":"@apify/n8n-nodes-apify.apify","position":[992,-96],"parameters":{"actorId":{"__rl":true,"mode":"url","value":"https://console.apify.com/actors/FbqC9BRstFBddhUqj/input"},"timeout":{},"customBody":"={\n \"firstName\": \"{{ $json.output.firstName }}\",\n \"lastName\": \"{{ $json.output.lastName }}\"\n}"},"credentials":{"apifyApi":{"id":"5UtrVw2KKdiQDN3s","name":"Apify account"}},"typeVersion":1},{"id":"f82112e5-7c7e-4a82-b5ab-5291971ea83d","name":"Scrap what this person posted recently","type":"@apify/n8n-nodes-apify.apify","position":[1408,-96],"parameters":{"actorId":{"__rl":true,"mode":"url","value":"https://console.apify.com/actors/r4oNX7IHlW4RQAjKP"},"timeout":{},"customBody":"={\n \"usernames\": [\n \"{{ $json.linkedinProfileUrl }}\"\n ]\n}"},"credentials":{"apifyApi":{"id":"5UtrVw2KKdiQDN3s","name":"Apify account"}},"typeVersion":1},{"id":"c43e8ab6-e80f-40f6-9f1d-05578ae31ed4","name":"Structure recent posts","type":"@apify/n8n-nodes-apify.apify","position":[1600,-96],"parameters":{"limit":20,"offset":{},"resource":"Datasets","datasetId":"={{ $json.defaultDatasetId }}"},"credentials":{"apifyApi":{"id":"5UtrVw2KKdiQDN3s","name":"Apify account"}},"typeVersion":1},{"id":"db0f0a46-4a09-493c-ae47-a68de7477131","name":"GPT 4.1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2000,112],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1","cachedResultName":"gpt-4.1"},"options":{},"builtInTools":{}},"credentials":{"openAiApi":{"id":"DIbcbQDS2wPTd9JM","name":"OpenAi account 3"}},"typeVersion":1.3},{"id":"644f0556-3a48-4e63-b80b-54c724c30cf4","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-960,592],"parameters":{"color":6,"width":880,"height":576,"content":"# 🎙️ Video Walkthrough\n@[youtube](-4VwNYsOIPc)"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"a5903b61-eb44-4418-a26b-75e1a3b983a9","connections":{"HTML":{"main":[[{"node":"Send report via Email","type":"main","index":0}]]},"GPT 4.1":{"ai_languageModel":[[{"node":"Summer McBriefing","type":"ai_languageModel","index":0}]]},"Webhook":{"main":[[{"node":"Do we have a full name ?","type":"main","index":0}]]},"Aggregate":{"main":[[{"node":"Summer McBriefing","type":"main","index":0}]]},"Summer McBriefing":{"main":[[{"node":"HTML","type":"main","index":0}]]},"Find Linkedin Profile":{"main":[[{"node":"Get Linkedin Profile URL","type":"main","index":0}]]},"Structure recent posts":{"main":[[{"node":"Aggregate","type":"main","index":0}]]},"Do we have a full name ?":{"main":[[{"node":"Extract firstName and lastName","type":"main","index":0}],[{"node":"Tell on slack that no full name was found","type":"main","index":0}]]},"Get Linkedin Profile URL":{"main":[[{"node":"Scrap what this person posted recently","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Summer McBriefing","type":"ai_outputParser","index":0}]]},"Extract firstName and lastName":{"main":[[{"node":"Find Linkedin Profile","type":"main","index":0}]]},"GPT 4.1-mini for classification":{"ai_languageModel":[[{"node":"Do we have a full name ?","type":"ai_languageModel","index":0}]]},"Scrap what this person posted recently":{"main":[[{"node":"Structure recent posts","type":"main","index":0}]]},"GPT 4.1-mini to extract firstName + lastName":{"ai_languageModel":[[{"node":"Extract firstName and lastName","type":"ai_languageModel","index":0}]]}}}
\ No newline at end of file