What This Agent Does
This powerful automation workflow seamlessly synchronizes your Google Drive video library with Google Sheets while automatically publishing your best content to Facebook Reels on a consistent schedule. The agent continuously scans your Drive for MP4 videos, maintains an organized inventory in your spreadsheet, and intelligently publishes unpublished videos to your Facebook page every 30 minutes—all without manual intervention.
Key benefits and time savings:
-
Automated video discovery: Eliminates manual file browsing by scanning Google Drive hourly
-
Centralized inventory management: All videos automatically logged in Google Sheets for easy tracking
-
Hands-free publishing: Videos publish to Facebook Reels on a predictable schedule without your involvement
-
Status tracking: Automatically marks videos as published, preventing duplicate uploads
-
Time reclaimed: Save 5-10 hours weekly on video management and social media posting tasks
Target use cases:
- Content creators managing multiple video libraries across platforms
- Social media managers automating Reel distribution
- Marketing teams maintaining consistent posting schedules
- Digital agencies handling client video content workflows
Who is it for
This workflow is ideal for:
-
Content creators and influencers who produce regular video content and want to maximize reach without manual posting
-
Social media managers responsible for maintaining consistent posting schedules across multiple platforms
-
Marketing teams seeking to automate content distribution workflows
-
Digital agencies managing video libraries for multiple clients
-
Small business owners wanting professional social media presence without dedicated staff
No coding experience required—this agent handles all technical complexity while you focus on creating great content.
Required Integrations
Google Drive
Why it's needed:
Google Drive serves as your video repository. This integration enables the agent to automatically scan for MP4 files, retrieve video metadata, and download videos for publishing.
Setup steps:
-
Access Google Cloud Console
- Navigate to Google Cloud Console
- Create a new project or select an existing one
- Name it something memorable like "TaskAGI Video Automation"
-
Enable Google Drive API
- In the Cloud Console, search for "Google Drive API"
- Click the result and select Enable
- Wait for the API to activate (usually 30 seconds)
-
Create Service Account Credentials
- Go to Credentials in the left sidebar
- Click Create Credentials → Service Account
- Fill in the service account name (e.g., "TaskAGI-Drive-Agent")
- Click Create and Continue
- Grant the service account "Editor" role for Google Drive access
- Click Continue and then Done
-
Generate API Key
- Click on the newly created service account
- Navigate to the Keys tab
- Click Add Key → Create new key
- Select JSON format
- Click Create (a JSON file downloads automatically)
- Store this file securely—you'll need it for TaskAGI
-
Configure in TaskAGI
- In TaskAGI, navigate to Integrations → Google Drive
- Select Service Account Authentication
- Paste the contents of your downloaded JSON file
- Click Verify Connection
- You should see a success message confirming access
Google Sheets
Why it's needed:
Google Sheets acts as your video inventory database, tracking which videos exist, their metadata, and publication status. This integration enables automatic row appending and cell updates.
Setup steps:
-
Enable Google Sheets API
- Return to Google Cloud Console (same project as above)
- Search for "Google Sheets API"
- Click the result and select Enable
-
Use Existing Service Account
- The service account you created for Google Drive already has Sheets permissions
- No additional credentials needed
-
Create Your Tracking Spreadsheet
-
Share with Service Account
- Click Share in your spreadsheet
- In your JSON credentials file, find the
client_email value
- Paste this email in the share dialog
- Grant Editor access
- Click Share
-
Obtain Sheet URL
- Copy the full URL from your browser address bar
- Format:
https://docs.google.com/spreadsheets/d/[SHEET_ID]/edit
- You'll need this for configuration
-
Configure in TaskAGI
- Navigate to Integrations → Google Sheets
- Select Service Account Authentication
- Paste the same JSON credentials
- Click Verify Connection
- Confirm successful authentication
Configuration Steps
Phase 1: Google Drive Scanning Setup
Node: Scan Drive (Hourly)
-
Trigger Type: Schedule Interval
-
Frequency: Every 1 hour
-
Purpose: Initiates the workflow automatically every 60 minutes
-
Configuration: No user input required—this runs on schedule
Node: Search MP4 Videos in Drive
-
Search Query:
mimeType = 'video/mp4' and trashed = false
-
Folder ID: Enter your Google Drive folder ID (found in the folder's URL after
/folders/)
-
Max Results: Set to
100 (adjust based on your video volume)
-
Purpose: Locates all MP4 files in your designated folder
Node: Loop Through Videos
-
Input: Results from Search MP4 Videos node
-
Loop Variable:
video_item
-
Purpose: Processes each video individually through subsequent steps
Phase 2: Sheet Inventory Management
Node: Append Video to Sheet
-
Sheet URL: Paste your Google Sheets URL here
-
Sheet Name:
Sheet1 (or your actual sheet name)
-
Row Data to Append:
[
video_item.name,
video_item.id,
"https://drive.google.com/file/d/" + video_item.id,
"No",
"",
""
]
-
Purpose: Adds each discovered video to your tracking sheet
Phase 3: Facebook Publishing Setup
Node: Set Facebook Credentials
-
Facebook Page Access Token:
- Go to Facebook Developers
- Create an app or use existing one
- Navigate to Tools → Graph API Explorer
- Select your page and request
pages_manage_metadata permission
- Generate a long-lived token (valid for ~60 days)
- Paste the token here
-
Facebook Page ID: Found in your Facebook page URL or Graph API Explorer
-
Purpose: Authenticates all Facebook API requests
Node: Publish Reels (Every 30 min)
-
Trigger Type: Schedule Interval
-
Frequency: Every 30 minutes
-
Purpose: Initiates publishing workflow on a consistent schedule
Node: Get Video Row from Sheet
-
Sheet URL: Your Google Sheets URL
-
Sheet Name:
Sheet1
-
Purpose: Retrieves all video records for processing
Node: Extract First Unpublished Row
-
Filter Condition:
Published column = "No"
-
Sort: By row number (ascending)
-
Purpose: Identifies the next video ready for publishing
Node: Check If Video Found
-
Condition:
if video_row exists
-
True Path: Proceed to download and publish
-
False Path: Execute No Videos to Publish (no-op)
-
Purpose: Prevents errors when no unpublished videos exist
Phase 4: Video Publishing Process
Node: Initialize Upload Session
Node: Download Video from Drive
-
File ID: From extracted video row
-
Destination: Temporary storage
-
Purpose: Retrieves the actual video file
Node: Get Video Size
-
Input: Downloaded video file
-
Output: File size in bytes
-
Purpose: Validates file meets Facebook requirements (max 4GB)
Node: Upload Video Binary
-
HTTP Method:
POST
-
Endpoint:
https://graph.instagram.com/v18.0/{upload_session_id}/video
-
Body: Binary video data
-
Purpose: Uploads video to Facebook servers
Node: Wait for Processing
-
Duration: 30 seconds
-
Purpose: Allows Facebook time to process video before publishing
Node: Publish the Reel
Node: Update Sheet - Mark Published
-
Sheet URL: Your Google Sheets URL
-
Cell Reference: Published column for current row
-
New Value:
Yes
-
Additional Update: Publish Date column = current timestamp
-
Purpose: Prevents duplicate publishing and tracks completion
Testing Your Agent
Step 1: Pre-Flight Verification
-
Verify integrations are connected
- Go to Integrations dashboard
- Confirm green checkmarks next to Google Drive and Google Sheets
- Test connection buttons if available
-
Validate spreadsheet setup
- Open your Google Sheets tracking document
- Confirm column headers are in Row 1
- Ensure the sheet is shared with your service account email
-
Check Facebook credentials
- Verify your access token is valid (tokens expire after 60 days)
- Confirm your page ID is correct
- Test token in Graph API Explorer
Step 2: Execute Test Run
-
Trigger manual execution
- In TaskAGI, click Test Workflow
- Select "Scan Drive (Hourly)" trigger
- Click Run Test
-
Monitor execution
- Watch the node-by-node progress in real-time
- Check for any error messages in red
- Verify each node completes successfully (green checkmarks)
Step 3: Verify Each Phase
Google Drive Scanning:
- Confirm videos were found in your Drive
- Check that the search returned expected MP4 files
- Verify file count matches your actual Drive contents
Sheet Population:
- Open your Google Sheets document
- Verify new rows appeared with video data
- Check that all columns populated correctly (name, ID, URL, status)
- Confirm "Published" column shows "No" for new entries
Facebook Publishing:
- Manually trigger the "Publish Reels (Every 30 min)" workflow
- Monitor the HTTP request nodes for successful responses
- Check your Facebook page after 2-3 minutes
- Verify the video appears in your Reels section
Status Tracking:
- Return to Google Sheets
- Confirm the "Published" column updated to "Yes" for published videos
- Verify the "Publish Date" column shows the current timestamp
- Ensure no duplicate videos were published
Expected Results and Success Indicators
Successful workflow execution shows:
- ✅ All 17 processing nodes complete without errors
- ✅ New videos appear in Google Sheets within 1 hour of being added to Drive
- ✅ Videos publish to Facebook Reels every 30 minutes
- ✅ Published videos marked with "Yes" status and timestamp
- ✅ No duplicate videos published to Facebook
- ✅ Workflow logs show consistent hourly scans and 30-minute publishing cycles
Troubleshooting tips:
- If videos don't appear in Sheets: Verify folder ID and API permissions
- If publishing fails: Check Facebook token validity and page ID
- If duplicates publish: Ensure "Published" column updates correctly
- If workflow doesn't trigger: Confirm schedule settings are active
Your automation is now ready to streamline your video management workflow!