
Automatic Cleanup of Scheduled Posts When a Card Is Unapproved
An n8n workflow that checks every 15 minutes for cards that are no longer approved and removes their still-scheduled posts from Metricool, without touching anything already published or about to go out.
n8n Automations- n8n
- Airtable
- Metricool
- X
- Threads
Project Overview
This project automates the cleanup of scheduled social media posts using n8n, Airtable, and Metricool. When a content card is denied, returned to review, or has a scheduling failure, its previously scheduled posts may still be waiting to publish.
The workflow checks Airtable every 15 minutes for cards with statuses such as Pending Review, Denied, Schedule Failed, or a blank status. It retrieves the associated Metricool post IDs, checks each post's current state, and applies safety rules to determine whether it should be deleted, retained, cleared from the card, or checked again later.
The workflow also updates Airtable with the results, clears obsolete post IDs, records timestamped audit entries, and removes the scheduled time when a post is deleted so the content can be scheduled again after approval.
Technology stack: n8n, Airtable, Metricool, X, Facebook, LinkedIn, Threads.
01. The Business Problem: Unapproved Content Can Still Be Published
A content team manages social media scheduling through Airtable cards and Metricool. Each card stores the Metricool post IDs for its scheduled posts across supported social platforms.
If a card's approval status changes after scheduling, the posts already queued in Metricool may still be published. Without an automated cleanup process, the team must manually locate and unschedule each post.
The main challenges include:
- Approval changes after scheduling: Posts can remain queued even after a card is denied or returned for review.
- Multiple social platforms: A single card can contain separate Metricool post IDs for X, Facebook, LinkedIn, and Threads.
- Publishing safety: Deleting a post that is already published or about to go live can create unnecessary disruption.
- Repeated processing: Previously handled post IDs should not be checked repeatedly on every scheduled run.
- Auditability: The team needs a record of which posts were deleted, retained, or cleared, and when.
- Temporary API failures: A failed lookup or deletion should not prevent the workflow from processing other posts.
The goal was to make scheduled-post cleanup automatic while maintaining strict safeguards around publishing status and timing.
02. The Solution: Automated Unscheduling with Safety Checks
A single n8n workflow runs every 15 minutes and searches Airtable for cards that may require cleanup.
The workflow separates each eligible card into individual Metricool post IDs and checks each post sequentially, with a short pause between API calls. A decision step determines whether each post should be deleted, kept, cleared, or retried during a later run.
Only future, unpublished posts that meet the deletion criteria are sent to Metricool's delete endpoint. Published posts and posts due within the next five minutes are protected. Posts that are already overdue but are not marked as published are also left untouched for manual checking.
After processing, n8n updates the corresponding Airtable card, clears IDs for deleted or already-missing posts, records timestamped decisions in the Unschedule Log, and clears the Scheduled Time when a post is deleted.
If a lookup or deletion fails, the workflow leaves the relevant record untouched so that a later run can retry it.
03. Project Snapshot
| Item | Detail |
|---|---|
| Platform | n8n |
| Schedule | Every 15 minutes |
| Source of approval status | Airtable |
| Social scheduling platform | Metricool |
| Supported networks | X, Facebook, LinkedIn, Threads |
| Input | Airtable cards and Metricool post IDs |
| Decision logic | Status, publishing state, and scheduled time |
| Processing method | One post ID at a time |
| Audit trail | Timestamped Unschedule Log in Airtable |
| Error handling | Failed lookups and deletions remain available for retry |
| Status | Live and running on an automatic schedule |
04. How the System Works
Step 1: Find Cards Requiring Cleanup
Every 15 minutes, the workflow searches Airtable for cards with a status of Pending Review, Denied, Schedule Failed, or blank, provided they still contain a Metricool post ID.
This identifies content that may no longer be eligible for publication but still has scheduled posts associated with it.
Step 2: Split Cards into Individual Posts
A code node converts each eligible card into one item per Metricool post ID.
The workflow checks its processing log and skips IDs that have already been handled and recorded. This reduces unnecessary repeated processing of settled posts.
Step 3: Retrieve Each Post from Metricool
The workflow requests the current details of each post from Metricool, processing one post at a time with a short pause between requests.
If an API lookup fails, the error does not stop the entire workflow. The affected post is left untouched so the workflow can try again during a subsequent run.
Step 4: Apply the Safety Rules
A decision step evaluates the retrieved post information and assigns an action:
- Delete: The post is unpublished and scheduled sufficiently far in the future.
- Keep: The post is already published or is due within the next five minutes.
- Clear: Metricool no longer has the post, so the stale ID can be removed from Airtable.
- Retry later: A lookup or deletion fails, leaving the relevant record unchanged for another attempt.
An overdue post that is not marked as published is not automatically deleted. Instead, the workflow records that someone should check its status in Metricool.
Step 5: Delete Eligible Posts
The Delete? branch sends a deletion request to Metricool only for posts marked for deletion.
Posts assigned any other action bypass the deletion request and continue through the merge step. This keeps the delete operation separate from the logic that decides whether deletion is safe.
Step 6: Update Airtable and Record the Outcome
After the deletion and non-deletion branches merge, a code node prepares one update per Airtable card.
The workflow:
- Clears IDs for posts that were deleted or were already missing from Metricool.
- Adds a timestamped entry to the card's Unschedule Log for each handled post.
- Clears the Scheduled Time when a post is deleted, allowing the content to be scheduled afresh after approval.
- Leaves failed lookup or deletion records unchanged so they can be retried.
Airtable stores the resulting updates, giving the team a record of the cleanup decisions.
05. Workflow Architecture

The workflow has four main functional layers:
- Discovery: Finds Airtable cards that may have obsolete scheduled posts.
- Post-level processing: Handles each Metricool post ID separately.
- Safety and action routing: Determines whether a post should be deleted, kept, cleared, or retried.
- Record synchronization: Updates Airtable IDs, scheduled times, and the audit log.
This separation helps ensure that a post is not deleted simply because its Airtable card has an unsuitable status. Its individual publishing state and scheduled time must also satisfy the safety rules.
n8n Workflow

06. Safety Rules and Deletion Logic
The workflow applies the following rules before deleting a scheduled post.
| Post condition | Action | Reason |
|---|---|---|
| Future post, not published, and more than five minutes from its scheduled time | Delete | Eligible for automatic cleanup. |
| Already published | Keep | Published content must not be deleted by this workflow. |
| Scheduled within the next five minutes | Keep | Avoid interfering with content about to go live. |
| Past its scheduled time but not marked as published | Keep and flag for manual checking | Avoid making an unsafe assumption about its status. |
| Metricool no longer has the post | Clear the stale post ID | The post is already gone, so the ID no longer needs to remain on the card. |
| Lookup or deletion request fails | Leave unchanged and retry later | Preserve the record for a subsequent attempt. |
The same safety rules apply across all supported networks, including X.
07. Airtable Synchronization and Audit Logging
Airtable remains the central record of approval status and scheduled-post identifiers.
After processing, the workflow synchronizes the card with the actual cleanup outcome.
| Airtable field or record | Purpose |
|---|---|
| Card status | Identifies content that may require unscheduling. |
| Metricool post IDs | Tracks the scheduled posts associated with the card. |
| Unschedule Log | Records timestamped actions and decisions. |
| Scheduled Time | Cleared when a post is deleted so it can be scheduled afresh. |
The log provides visibility into what was deleted, retained, or cleared, along with the time of the action. Failed operations remain available for retry rather than being treated as successful cleanup.
08. Reliability and Error Handling
The workflow is designed to continue processing other posts when an individual operation encounters an error.
Sequential API Requests
Metricool is called one post at a time, with a short pause between requests. This reduces the risk of overwhelming the service when many cards require cleanup.
Failure Isolation
A failed lookup or deletion does not stop the entire workflow. The affected post is left untouched, allowing a later run to retry it.
Previously Handled IDs
IDs that have already been handled and logged are skipped, reducing repeated checks of settled posts.
Separate Decision and Deletion Paths
The workflow sends only posts explicitly marked for deletion to Metricool's delete operation. All other decisions bypass the delete request and continue through the merge path.
These controls reduce unnecessary API calls and help protect posts that should remain scheduled. They do not imply that API failures or every possible scheduling edge case are eliminated.
09. Results and Operational Capabilities
The project description confirms that the workflow is live and runs automatically. It does not provide measured figures for the number of posts cleaned up, API success rate, time saved, or prevented accidental publications.
Implemented Capabilities
- Automatic checks every 15 minutes.
- Identification of Airtable cards requiring scheduling cleanup.
- Individual processing of Metricool post IDs.
- Skipping of previously handled and logged IDs.
- Protection for published posts and posts due within five minutes.
- Manual-review handling for overdue posts not marked as published.
- Removal of eligible future, unpublished posts.
- Cleanup of stale post IDs when posts are already missing.
- Timestamped Unschedule Log entries.
- Scheduled Time clearing after deletion.
- Retry behavior for failed lookups and deletion requests.
Metrics to Measure Next
A measured production review could track:
- Number of cards and posts evaluated per run.
- Number of posts deleted, retained, cleared, and retried.
- Average time between an approval-status change and cleanup.
- Number of failed Metricool requests.
- Number of posts that require manual status checks.
- Number of duplicate or unnecessary cleanup attempts.
- Any cases where an unapproved post remained scheduled or a valid post was incorrectly targeted.
These figures would help quantify the operational value and verify the effectiveness of the safety rules.
10. Key Takeaways
- Approval status must remain synchronized with scheduling: Changing an Airtable card does not automatically remove a post already queued in Metricool.
- Evaluate individual posts before deletion: A card's status alone is not enough to determine whether every associated post can safely be removed.
- Protect publishing boundaries: Published posts, posts due within five minutes, and ambiguous overdue posts receive special handling.
- Keep an audit trail: Timestamped Unschedule Log entries make cleanup decisions visible to the team.
- Handle failures without losing state: Failed operations remain available for a later retry.
- Use sequential API calls: Processing posts one at a time helps control the request rate.
11. Future Development
The next stage should focus on measuring reliability and improving operational visibility.
- Add a periodic summary of deleted, retained, cleared, and retried posts.
- Track repeated failures and alert the team when a post remains unresolved across multiple runs.
- Measure the time between card-status changes and successful cleanup.
- Review manual-check cases to determine whether additional Metricool status signals could safely resolve them.
- Test the workflow against edge cases involving multiple networks, missing post IDs, schedule changes, and posts close to their publication time.
- Maintain an audit of cleanup outcomes to support ongoing verification of the deletion safeguards.
12. Final Outcome
The Automatic Cleanup of Scheduled Posts workflow provides an automated safeguard between Airtable approval decisions and Metricool's publishing queue.
By checking cards every 15 minutes, evaluating each associated post, applying time- and status-based deletion rules, and recording the outcome in Airtable, it helps prevent obsolete scheduled content from being left in the publishing queue.