I created an automation that streamlines the process of generating and scheduling social media posts from a single Airtable base. This guide will walk you through setting up a system that can either scrape content from a URL or generate it based on a topic, making your social media management more efficient than ever.
Overview
This automation simplifies the process of generating and scheduling social media posts from a single Airtable base. Users can enter a URL to scrape content or a topic for research-based generation. The entire process is designed to enhance efficiency in social media management.
Demo of the Automation
In the demo, I show how to initiate the automation by entering a topic or URL. By clicking a button, the automation triggers a sequence that fetches relevant data and generates content tailored for various social media platforms. This allows for a seamless experience in managing multiple accounts.
Setting Up Your Airtable Base
To begin, set up your Airtable base with specific fields. The first column should be an auto-number type, which updates automatically. You’ll need a button field for triggering the automation and a date field to schedule posts. Additionally, include multiple select options for social platforms and long text fields for each platform’s content.
Triggering the Automation with Airtable
The automation is activated via a button that triggers a webhook. This webhook sends the record ID of the Airtable row to the automation platform. It’s essential to ensure that the correct base and table are selected for seamless integration.
Input Handling: URL vs. Topic
When inputting data, the automation differentiates between a URL and a topic. If a URL is provided, the system scrapes the data; if a topic is entered, it uses a research model to gather relevant information. This flexibility allows users to generate content based on their needs.
Scraping URLs with Jina.ai
For URL scraping, the automation employs Jina.ai to fetch a cleaner markdown version of the page. This method avoids the bulk of unnecessary data that could complicate the content generation process. By using this approach, the automation stays efficient and cost-effective.
Image Generation with fal.ai
Image generation is handled through fal.ai, where a request is made to create a relevant image based on the generated content. The prompt for the image generation is simplified for clarity, ensuring that the resulting visuals align with the social media posts. This integration enhances the overall appeal of the posts.
Updating Airtable Records with Generated Content
After generating the content, the next step is to update the Airtable records with the newly created data. This process ensures that all generated text and images are stored correctly within your base. Using the “Update a Record” module in Airtable, I map the generated content to the corresponding fields in the Airtable base.
For instance, I take the generated text for each platform—Facebook, Instagram, LinkedIn, and Twitter—and place it into its respective long text field. The image generated by fal.ai is also uploaded into the attachment field. This way, all relevant information is consolidated in one place, making it easy to manage and review.
Using Perplexity API for Topic Research
When entering a topic instead of a URL, I leverage the Perplexity API for research. This API allows me to gather current insights and data related to the specified topic. By setting up a request in the automation, I can pass the topic to the API and receive a comprehensive response.
The response typically includes various facts, figures, and insights that I can then use to formulate engaging social media posts. This ensures the content I create is not just relevant but also informative. The ability to access real-time data gives my posts an edge in staying current with industry trends.
Alternative Trigger: Status Change in Airtable
For those using the free version of Airtable, there’s an alternative way to trigger the automation without pressing a button. By changing the status of a record to “Generate Content,” the automation can be configured to run automatically. This is done by creating a separate scenario that monitors the Airtable base for any changes in status.
When the status changes, the automation will collect the record ID and trigger the content generation process. This method allows for a more streamlined workflow, as posts can be generated without manual intervention. It’s a great way to keep your social media content fresh and ready to go.
Scheduling Workflow for Posting
To manage the timing of posts, I set up a scheduling workflow that runs at regular intervals. This automation checks for records marked as “Ready for Posting” and ensures they are published on time. By using a search records module, I can filter the records based on their scheduled date and status.
This setup allows me to control when each post goes live, ensuring that I don’t overwhelm any social media platform. In my configuration, I limit the search to pick up only one record at a time, which helps prevent any posting errors.
Posting Logic: Routing to Platforms
Once the scheduled workflow identifies a record ready to post, it routes the content to the selected social media platforms. Each platform has its own posting logic, which I’ve configured using routers within the automation. For example, if the record includes a photo, the system first attempts to upload it as a photo post.
If no photo is present, it defaults to a text-only post. This conditional logic ensures that each platform receives the correct type of content, enhancing the user experience. By carefully mapping the fields from Airtable to the respective platform modules, I streamline the posting process.
Customizing the Automation for Your Needs
This automation is highly customizable, allowing me to tailor it to fit various use cases. For example, if I’m managing an e-commerce store, I might want to pull images directly from my product catalog instead of using AI-generated images. By replacing specific modules, I can ensure the automation meets my specific requirements.
Additionally, I can modify the tone of voice used in the posts. The prompts sent to the AI can be adjusted to reflect the brand’s personality, ensuring that the generated content resonates with the target audience. This flexibility makes the automation not only powerful but also adaptable to different business needs.