DEV Community

Built By AI Lab
Built By AI Lab

Posted on Edited on Originally published at bbal-blog.kairo-app.workers.dev

Keeping Automated Social Posting Safe: Six Rules My Pipeline Follows

My pipeline publishes short videos to Instagram and TikTok for three channels, and the only thing I do is approve them, with one Telegram message a day. After the config-file incident of September 30th I wrote down every rule the code now follows. Each one exists because of a specific way things can go wrong.

Start with account IDs. An Instagram ID is a long string of digits, and when one passes through a number type the last digits get rounded. A single wrong digit sends the post to a different account. Every ID in my files is now a string with quotes around it, even though it looks like a number.

The publisher also keeps each channel on its own account. A channel has its own narrator voice and its own language, and both are checked before anything is sent, so a video with the wrong voice just waits in the queue. Volume has a ceiling too: one video per channel per day, set as a constant in the code, so it holds even when I approve a lot at once.

A config file that fails to load stops everything, with no silent defaults anywhere. Facts follow the same logic. A post that depends on a schedule or a version number gets blocked once the fact sheet behind it goes stale, and it stays blocked until I confirm the fact again.

The last rule happens after publishing. A second script compares what my database says was published with what Instagram shows on the account. It caught a reel that my system had marked as published while the platform never finished processing it. Since then I trust that second check more than the log of the program that did the posting.

Top comments (0)