From chat to agent|INEMA.CLUB-PRO

Lesson 4 · 12 min

Step 3: queues — ten tasks, then go to sleep

An agent working alone does one thing at a time, and only while you’re watching. With a durable queue, each request becomes a saved task that can resume if something goes down, and workflows stop at a gate before anything important happens.

Start lesson

In this lesson, you will

  1. 1How a durable queue works
  2. 2Resume where it left off
  3. 3Where to put the human gate
  4. 4Measure how many came out right

Objective: decide what goes into the queue, where the gates go, and how to check the result the next day.

01A task’s journey

From request to result, with resuming and a gate.

Scroll down: each step below lights up its part of the diagram.

  1. 1/5

    Requests

    Each request becomes a task: in inemaccbot, a Telegram message; in a homemade queue, a .md file in the entrada/ folder.

  2. 2/5

    Durable queue

    The task is saved. If your computer shuts down or you stop, the next run picks up what’s left without redoing what’s already done.

  3. 3/5

    Agent

    The agent runs one task at a time. If it works, the response goes to feito; if there’s an error, it goes to falhou with the reason for you to check.

  4. 4/5

    Gate

    For workflows that matter, the bot writes and stops. You read it, make edits if needed, and only then approve it. That’s when you manage instead of doing the work yourself.

  5. 5/5

    A night in the queue

    You send the tasks and go to sleep. The queue saves them, the agent runs one at a time, and it stops at the gate for anything that matters. In the morning, you check feito/ and falhou/.

Examples of workflows that become tasks in inemaccbot: transcribe, dub, explainer video, course, and reel.

02See the queue in action

Run it, interrupt it halfway through, and run it again. That’s what the homegrown queue does.

entrada/

rodando/

feito/

falhou/

Illustrative browser simulation: the tasks don’t actually run. The failure is intentional, to show the falhou/ folder.

03The homegrown queue and the queue on paper

Understand the idea in 30 lines before installing the bot.

Terminal · homegrown queue (in the jornada-agentes repository)
mkdir -p fila/entrada
echo "Summarize in 5 lines what a task queue is." > fila/entrada/01.md
echo "List 3 risks of leaving an agent running on its own." > fila/entrada/02.md
./ferramentas/fila-caseira.sh fila          # default engine: claude
./ferramentas/fila-caseira.sh fila codex    # or codex
fila-no-papel.md
| Task | Runs on its own? | Needs a gate? | Where is the gate? |
|---|---|---|---|
| Transcribe the meeting | yes | no | — |
| This week’s post | yes | yes | before publishing |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
Repository example
  • /ping: checks whether the bot responds (at the end of installation).
  • /ajuda: lists the commands.
  • /fila: shows the queues.
  • /promoavatar: example of a workflow with a gate — the bot writes the text and stops for you to approve it.

04Practice: the 5 exercises in sequence 3

Prerequisite: sequences 1 and 2.

E1 · The queue on paper

15 min

List 10 repetitive tasks and mark whether they run on their own, need a gate, and where they run.

Done when: all 10 lines are filled in, and at least two have a gate.

E2 · A homemade queue in 30 lines

30 min

Create two tasks in queue/entrada and run fila-caseira.sh. Interrupt a run with Ctrl+C.

Done when: both are in queue/feito, and you saw the queue pick up where it left off.

E3 · Install inemaccbot

1 hr

Follow the guide until the bot responds in Telegram. Then test /ajuda and /fila.

Done when: /ping responds in your Telegram.

E4 · Ten tasks, then go to sleep

1 night

Send 5 to 10 tasks from your list and go do something else.

Done when: the next day, you checked each result and noted how many were right on the first try.

E5 · The gate

30 min

Use a workflow with a gate, such as /promoavatar: read it, make corrections, and only then approve it.

Done when: you rejected or corrected at least one text before approving it.

Complete exercises and the extra challenge (a new rule for the task that failed most often): jornada-agentes/exercicios/03-filas.md.

05Sequence 3 on video

inemaccbot's durable queue and approval gate.

Ten tasks, then go to sleep · 1 min 33 secVideo page with script →

06Test what you learned

The explanation appears after your answer.

Question 1 of 3

You interrupted the queue in the middle of a task. What happens when you run it again?

Go deeper on step 3

Previous lessonNext lesson