I manage socials for Aisle, myself, and a few other founders out of a single knowledge base. One piece of that is a "tweet log master" context file, and the job behind it never changes: pull a user's recent content and engagement, then write it back to a memory file. I've built that same job three different ways over time, and the gap between them says a lot about where Aisle has gone.
Two-prompt legacy workflow
A scheduled workflow loops over a list of users, pulls the data with one prompt, then hands it to a second prompt that merges the new data with the existing file and reprints the whole thing. Clean and simple to build. The catch is that it reads and writes the entire file every run, around 50,000 tokens, and that number only climbs as the log grows.
Single-prompt legacy workflow
Same result, one prompt. I dropped the second prompt in favor of two loops, some variable manipulation, and a regex lookup to slot templates into the right spots. Far more efficient at roughly 5,000 tokens. It's also a genuine pain to build, debug, and maintain.
Aisle Tasks
The whole thing written natively in Python: set up the variables, pull the file, run the prompt, splice by section headers, write back to the memory space. Same ~5,000 tokens as the single-prompt version, but much easier to reason about, debug, and maintain. It runs faster too.
If you know a little Python, this is where it's landed for me.
How are you handling your automations? Reply and tell us.
Video transcript
Hey, Mitch from Aisle here. I wanted to take you through some of the AI automations that I've built to run this is X project in Aisle. This is the project that I use to to draft and manage all of the company socials, my personal socials, other founder socials as well. This is heavily reliant on this is Twitter knowledge base. Essentially, this is a bunch of context that all of the different agents and chats that we have in that project can access.
in particular, this tweet log master file, which pulls Twitter activity for a bunch of different users and also has some custom reasoning to to understand different engagement and all of that kind of stuff. That's all embedded within a prompt that can be called. And so I wanted to take you through three different ways that you can automate that on the platform today. The first two are using our legacy workflows feature, right? So on a schedule I can have a variable that is a number of different Twitter usernames and I can run that prompt in a loop, right?
I can find that file and then I can run a second prompt that basically takes the old file, takes the outputs of the loops, figures out where it needs to update things in all the all of that context, and basically writes a new file every time. relatively clean workflow, pretty token maxi though, right? This I think it it ends up burning 45k or 50k tokens and you don't really need to. That's primarily because this master upsert prompt is it's basically reading and writing the file every time and token usage is only going to grow the bigger that file gets. And it's pretty wasteful, especially when you consider that this second version, which is a single prompt but multiple loop version of a workflow only burns 5k tokens, right?
Same initial setup. You have a bunch of users as variables in here, right? And then it runs that on a loop. It finds the master file in the memories knowledge base, right? But then you get into some data wrangling and object manipulation.
So you have to set a variable which is the old file and then we run a second loop that takes the output array from the first loop and creates a template. And then there's a reax lookup that is finding the right place within this initial variable that we created to inject this template. And then you are flattening the response and dduping the entries in this loop and then overriding the entire memory. As I said, only burns 5k tokens. It's much cheaper.
The difficulty here ends up being maintenance, right? If something breaks, there are a number of different places where you have to figure out where it broke down. Candidly, this one took me quite a while to build. And if you are adept at building workflows in this way, you understand variable manipulation and plucking values and all of that kind of stuff, I think this is the wrong approach for you. Anyway, where we've landed is using our new tasks feature, writing this entire automation just as a Python script, right?
Same token burn as the second option, 5k tokens, right? But it is much cleaner, much easier to understand and debug, right? So you can read this pretty linearly to understand what it does. It's running every day. It's pulling the last 72 hours of posts.
You're setting the folder ID, the file ID, and the file name up front. You are setting the users as variables up front as well. And then you are just running through a Python script that is running that prompt the certain number of times. It is doing the text lookup of the master file and updating it in the right place and it is running that every morning. Same token burn much easier to debug and look at and also runs a lot quicker is something that we found as well.
So yeah, I thought I'd just show you that the evolution of AI automation for us, how we've moved from canvas based workflows to tasks. Interested to know your thoughts. What approach would you take for automating something like this? Thanks.