Back to Catalog
James Francis

James Francis

👋 Hi, I'm James. I run an AI automation agency focused on building small, focused workflows that have a direct and measurable impact on business growth or optimization.

Total Views4,671
Templates3

Templates by James Francis

Create a Slack AI chatbot with threads & thinking UI using OpenRouter & Postgres

Overview Slack quietly released an update to their API that allows developers to build "AI Apps & Agents", which is a special classification of apps that have access to several special capabilities including: Multiple simultaneous chat threads with one user Loading "three dots" UI while your agent is thinking Option for users to pin your app to their top bar for quick chat access This workflow demonstrates how to build a Slack agent that takes advantage of all of these features. For a full video walkthrough of this workflow, watch this YouTube tutorial. Setup Instructions All of the below steps are required for this workflow to function properly unless otherwise noted. Create a Slack App Visit api.slack.com and click "Your Apps" Create a new app from scratch and follow the setup instructions In the Agents & AI Apps tab, enable the toggle and give your app a brief description In the OAuth & Permissions tab, enable the following bot token scopes: assistant:write chat:write channels:read im:history Install the app into your workspace and grant the requested permissions In your Slack workspace, right click your app's name in the sidebar, click "View app details", and make note of your apps Channel ID - you'll need this later. Copy your app's Bot User OAuth Token - you'll need that to create your n8n credentials In the Event Subscriptions tab, enable events and paste the workflows PRODUCTION webhook url (from this workflow's trigger node) into the input. In the same tab under "Susbcribe to bot events", select message.im Create a Postgres database In order to save the chat history and give your agent a working memory, you'll need your own Postgres database. You can use Supabase, Neon, or any other Postgres database provider. Once you've added your database's credentials to n8n, you can select those credentials in the Postgres Chat Memory node. This worklow saves all chat history in a table called chat_histories, but you name the table whatever you want. Create n8n Credentials You'll need to create the following credentials: Slack API. Use your Bot User OAuth Token referenced above. Bearer Auth. Use the same Bot User OAuth Token. Postgres. Use the connection string or config from your database provider. OpenRouter (or any other LLM model for the agent's model node) Wire Everything Up Now that you've created your Slack app, have your Postgres database, and have created credentials, follow these steps to wire up your workflow: In the "On Message Received" trigger, use your Slack API credential and enter your apps Channel ID in the "Channel To Watch" field. In the "Set Thinking Status" node, use your Bearer Auth credential. In the "Postgres Chat Memory" node, use your Postgres credential. In the "Send Reply" node, use your Slack API credential. Using the Chatbot Once you've completed the setup process and added in your credentials, you'll have a fully functional Slack chatbot complete with threads, loading UI, and the ability to pin your app to your workspace's top bar. Taking the Next Steps Now that this skeleton app is in place, it's up to you to add horsepower to the AI agent at the center of it all. Customize the prompts and add whatever tools you'd like. The sky is the limit! If you have any questions or feedback about this workflow, or would like me to build custom workflows for your business, email me at n8n@paperjam.agency.

James FrancisBy James Francis
2986

Clean company names for cold emails with GPT-4 Mini and Google Sheets

Overview In cold email campaigns, the lead's company name is the 2nd most frequently inserted variable after their first name. They're critical for effective cold email personalization. However, company names are often messy and can contain taglines, legal suffixes (e.g. LLC, Inc.), and other variations that would never be written out by a human in an email. If your email starts with "I came across Techwave Solutions LLC on LinkedIn...", it's a dead giveaway that you're sending a tempalted email and a response is much less likely. This simple workflow uses AI to clean up messy company names in a Google Sheet so that your cold email campaigns can achieve better results. How It Works A form is submitted with a Google Sheet url The workflow grabs the leads and uses an LLM node to clean the company names The updated leads are saved back in a new sheet within the original spreadsheet Setup Steps Add your Google Sheets and OpenAI (or your AI model provider of choice) credentials to n8n Create a Google Sheet with your list of leads. IMPORTANT: the sheet MUST have a column called "Company" (Optional). The AI workflow has a highly optimized system prompt. However, you may achieve better results by updating the list of examples in the prompt with companies (real or fake) in the industry you're targeting. If you have any questions or feedback about this workflow, or would like me to build custom workflows for your business, email me at n8n@paperjam.agency.

James FrancisBy James Francis
847

Gmail to Slack: AI-scored Upwork job alerts with OpenRouter

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Overview When applying for freelance jobs on Upwork, minutes matter. The first quality application is more often than not the one that's ultimately selected. Subscribers to Upwork's Freelancer Plus receive email job alerts, but filters are very limited. As a result, it takes a lot of time to manually go through each email and determine if each job fits your criteria. This workflow scans your Gmail every few minutes, finds all Upwork job alerts, scores them based on your profile/preferences, and sends a Slack channel message for jobs that are strong potential matches. How it works Scans Gmail for Upwork job alerts every few minutes Extracts all available job data from each email Scores the job based on profile information and criteria you provide Sends a Slack notification for all jobs that meet a given score threshold Disclaimers This workflow polls Gmail for new messages every 10 minutes. A workflow execution will be used each time, regardless of whether the Gmail scan finds anything. You may want to adjust this frequency based on the amount of workflow executions you want to use. The AI matching process is based only on the information included in the email body (job title, description snippet and metadata). It is against Upwork's Terms of Service to scrape a full job posting. Despite this, the quality of the results in our testing is high for most use cases. Required Setup Subscribe to Upwork's Freelancer Plus plan to enable job alerts ($19.99/mo at the time of this posting) Create Gmail and Open Router (or an LLM provider of your choice) credentials and select them in the Gmail / LLM Model nodes Create a Slack app that has at least the chat:write.public and channels:read scopes, install it into your workspace, and use your apps OAuth Token to create a Slack API credential in n8n IMPORTANT: In the "Opportuntity Scorer" node, replace the text in between the <my_profile> tags with your freelancer bio. For best results, include as much detail as possible about your skillset, experience, tool familiarity, and job preferences. Update the filter with your notification threshold preference(s) and update the Slack channel to send notifications to in the last Slack node If you have any questions or feedback about this workflow, or would like me to build custom workflows for your business, email me at n8n@paperjam.agency.

James FrancisBy James Francis
838
All templates loaded