# Enhanced Airtable Social Media Posts Table Design
## Overview
Improved version of Ayrshare's basic Airtable integration, adapted for sophisticated campaign management with linked Platform records and AI-generated content.
---
## Table: Social Media Posts Queue
**Purpose:** Staging area for posts ready to be published via Ayrshare/Make.com
### Core Fields
#### 1. **Post Content** (Long Text)
- The actual text that will be posted
- Can be manually written or pulled from Content Pieces
- **Smart Feature:** Auto-truncate based on linked Platform's character limit
#### 2. **Content Piece** (Link to Content Pieces table)
- Links to your existing Content Pieces table
- Pulls in: Content Title, Campaign, Brand, Theme
- **Benefits:**
- Reuse AI-generated content
- Track which content piece generated this post
- Maintain campaign relationships
#### 3. **Platform** (Link to Platforms table) - SINGLE SELECT
- Links to your existing Platforms table (Instagram, Facebook, etc.)
- **Benefits:**
- Auto-pull character limits, hashtag limits, media specs
- No need to manually configure each post
- Platform specs always up-to-date from master table
#### 4. **Generated Asset** (Link to Assets table)
- Links to AI-generated images/videos from MCP server
- **Benefits:**
- Use images generated by content-image-generation-mcp
- Track which asset was used
- Reuse assets across platforms
#### 5. **Status** (Single Select)
- Options: `Pending`, `Scheduled`, `Posted`, `Failed`, `Draft`
- **Automation trigger:** When changed to "Pending"
- **Auto-update:** Changes to "Posted" or "Failed" after API call
#### 6. **Schedule Date** (Date with Time)
- When to publish (or empty for immediate)
- Format: Local time, 24-hour
- **Smart Feature:** Warn if outside platform's best posting time
#### 7. **Posted URL** (URL)
- URL to the actual social media post after publishing
- Auto-populated by Ayrshare API response
- **Benefits:** Click to view live post
---
### Lookup Fields (Auto-populated from linked records)
#### From Platform:
- **Max Character Count** (Number - Lookup)
- **Hashtag Limit** (Number - Lookup)
- **Max File Size MB** (Number - Lookup)
- **Best Posting Start Time** (Text - Lookup)
- **Best Posting End Time** (Text - Lookup)
- **Caption Style Guidelines** (Text - Lookup)
#### From Content Piece:
- **Campaign** (Lookup)
- **Brand** (Lookup)
- **Hashtags** (Lookup)
#### From Generated Asset:
- **Asset Base64** (Lookup) - For API posting
- **Asset Cost** (Lookup) - Track costs
---
### Validation Fields (Formulas)
#### **Character Count Valid** (Formula - Checkbox)
```javascript
LEN({Post Content}) <= {Max Character Count (From Platform)}
```
Shows ✅ if post fits platform limit, ❌ if too long
#### **Within Best Time** (Formula - Checkbox)
```javascript
// Check if schedule time is within best posting window
IF(
AND(
{Schedule Date},
HOUR({Schedule Date}) >= HOUR({Best Posting Start Time}),
HOUR({Schedule Date}) <= HOUR({Best Posting End Time})
),
TRUE(),
FALSE()
)
```
Shows ✅ if scheduled during optimal time
#### **Hashtag Count** (Formula - Number)
```javascript
// Count hashtags in post content
LEN({Post Content}) - LEN(SUBSTITUTE({Post Content}, "#", ""))
```
#### **Hashtags Valid** (Formula - Checkbox)
```javascript
{Hashtag Count} <= {Hashtag Limit (From Platform)}
```
---
### Advanced Fields
#### 8. **Ayrshare Profile Key** (Single Line Text)
- For multi-client scenarios (Ayrshare Business plan)
- Leave empty for single-account use
- Links to specific social account
#### 9. **Post Type** (Single Select)
- Options: `Text Only`, `Image`, `Video`, `Carousel`
- Auto-detected from Generated Asset type
#### 10. **Posted At** (Created Time)
- Timestamp of when post was actually published
- Auto-populated when Status → "Posted"
#### 11. **Error Message** (Long Text)
- Captures API error if posting fails
- Auto-populated by automation script
#### 12. **Estimated Cost** (Currency)
- Sum of MCP generation cost + API posting cost
- Rollup from Generated Asset cost
#### 13. **UTM Parameters** (Long Text)
```
utm_source={Platform}
utm_medium=social
utm_campaign={Campaign}
utm_content={Content Piece ID}
```
---
## Table Structure Summary
| Field Name | Type | Source | Purpose |
|------------|------|--------|---------|
| Post Content | Long Text | Manual/Lookup | The actual post text |
| Content Piece | Link | Link to Content Pieces | Source content |
| Platform | Link | Link to Platforms | Target social platform |
| Generated Asset | Link | Link to Assets | AI-generated media |
| Status | Single Select | Manual/Automation | Workflow state |
| Schedule Date | Date/Time | Manual | When to post |
| Posted URL | URL | Automation | Link to live post |
| Ayrshare Profile Key | Text | Manual | Multi-account support |
| Post Type | Single Select | Auto | Text/Image/Video |
| Posted At | Created Time | Auto | Actual post time |
| Error Message | Long Text | Automation | Error details |
| Estimated Cost | Currency | Rollup | Total cost |
| Character Count Valid | Formula | Auto | ✅/❌ validation |
| Hashtags Valid | Formula | Auto | ✅/❌ validation |
| Within Best Time | Formula | Auto | ✅/❌ validation |
---
## Workflow: From Content to Post
```
1. Content Piece created (with AI-generated content)
↓
2. MCP Server generates images (stored in Assets table)
↓
3. Create Social Media Post record:
- Link to Content Piece
- Link to Platform (Instagram/Facebook/etc.)
- Link to Generated Asset
- Post Content auto-filled from Content Piece
↓
4. Review validation formulas:
- Character count OK? ✅
- Hashtags OK? ✅
- Scheduled at best time? ✅
↓
5. Set Status = "Pending"
↓
6. Airtable Automation triggers:
- Calls Ayrshare API
- Posts to social media
↓
7. Status auto-updates to "Posted"
- Posted URL populated
- Posted At timestamp set
```
---
## Make.com Integration (Alternative to Airtable Automation)
### Trigger: New Record with Status = "Pending"
### Steps:
1. **Get Record** - Fetch full record with all linked data
2. **Get Platform Specs** - Pull character limits, etc.
3. **Validate** - Check character count, hashtags
4. **Get Asset Base64** - If image/video attached
5. **Call Ayrshare API**
- Endpoint: `https://app.ayrshare.com/api/post`
- Method: POST
- Headers: `Authorization: Bearer YOUR_KEY`
- Body:
```json
{
"post": "{{Post Content}}",
"platforms": ["{{Platform}}"],
"mediaUrls": ["{{Asset Base64}}"],
"scheduleDate": "{{Schedule Date}}",
"profileKey": "{{Ayrshare Profile Key}}"
}
```
6. **Update Status** - Set to "Posted" or "Failed"
7. **Store Posted URL** - From API response
8. **Store Error** - If failed
### Cost: ~$9/month for Make.com (vs $29/month for Airtable automations)
---
## Advantages Over Basic Ayrshare Table
### Ayrshare Basic:
- ❌ Hardcoded platform names in multi-select
- ❌ Manual platform spec entry
- ❌ No validation
- ❌ No campaign tracking
- ❌ Attachments only (no AI generation integration)
### Your Enhanced Version:
- ✅ Linked Platform records (auto-update specs)
- ✅ Real-time validation (character count, hashtags, timing)
- ✅ Campaign/Brand/Theme relationships
- ✅ AI-generated content integration
- ✅ Cost tracking
- ✅ UTM parameter generation
- ✅ Best time recommendations
- ✅ Reusable assets
- ✅ Full audit trail
---
## Next Steps
1. **Create Table:** Copy field structure into new Airtable table
2. **Test Workflow:** Create one post manually
3. **Set Up Automation:**
- Option A: Airtable Automation (easier, more expensive)
- Option B: Make.com (cheaper, more powerful)
4. **Connect MCP Server:** Link generated assets to posts
5. **Scale:** Batch create posts from campaigns
---
## Example Record
```json
{
"Post Content": "Summer vibes with our new product! 🌊☀️ #SummerSale #NewArrival",
"Content Piece": "Link to: Summer Campaign - Product Launch",
"Platform": "Link to: Instagram",
"Generated Asset": "Link to: bear_pool_imagen.png",
"Status": "Pending",
"Schedule Date": "2025-11-10 18:00",
// Auto-populated lookups:
"Max Character Count": 2200,
"Hashtag Limit": 30,
"Best Posting Time": "6 PM - 9 PM",
// Auto-calculated validations:
"Character Count Valid": ✅,
"Hashtags Valid": ✅,
"Within Best Time": ✅,
// After posting:
"Posted URL": "https://instagram.com/p/ABC123",
"Posted At": "2025-11-10 18:00:05",
"Estimated Cost": "$0.04"
}
```
---
## Make.com Scenario Template
```
Trigger: Airtable > Watch Records (Status = "Pending")
↓
Module 1: Airtable > Get Linked Records (Platform, Asset, Content Piece)
↓
Module 2: Router
├─ If Character Count > Limit → Send Email Alert
├─ If No Asset → Skip posting
└─ Else → Continue
↓
Module 3: HTTP > Make Request (Ayrshare API)
↓
Module 4: Router (based on API response)
├─ If Success → Update Status = "Posted", Store URL
└─ If Error → Update Status = "Failed", Store Error
```
Total operations per post: ~5-7 (well within Make.com free tier of 1,000/month)
---
## Quick Setup Checklist
- [ ] Create "Social Media Posts Queue" table
- [ ] Add core fields (Post Content, Platform link, Asset link, Status, Schedule Date)
- [ ] Add lookup fields from Platform table
- [ ] Add validation formula fields
- [ ] Create test record
- [ ] Set up Make.com account (or Airtable automation)
- [ ] Configure Ayrshare API connection
- [ ] Test posting workflow
- [ ] Scale to batch posting