Queues: ten tasks and go to sleep|INEMA.CLUB-PRO

Lesson 6 · 18 min

Where the gates go: stop before what matters

A flow is a task with several stages, with the state saved at each one. The gate is the stage that ends and pauses: the bot shows you what it did and waits for you. Approving, correcting, or rejecting is when you manage the work instead of doing it yourself.

Start lesson
A slim metal gate, slightly open in a dark hallway, outlined by neutral light.

In this lesson, you’ll

  1. 1Skill × flow: when it makes sense to save state
  2. 2How the gate pauses and what it shows
  3. 3Approve, reject with a correction, redo, or cancel
  4. 4Practice with | sombra before spending

Goal: put the gate in the right place in a flow and decide whether to approve, reject with a correction, or cancel.

01A flow with a gate: /promoavatar

The domain flow running in production in inemaccbot.

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

  1. 1/5

    Request

    The command creates a numbered flow (A#9) and a list of stages. Each stage has its own state; /status shows each stage and each audience.

  2. 2/5

    Texts

    The agent writes a script for each audience (young people, women…). You don’t want to lose this work if a later stage fails, which is why this is a flow, not a skill.

  3. 3/5

    Gate

    The phase ends, and the bot sends what it declared to show in the chat, then STOPS. You read it, make corrections, and save the avatars. The flow continues only with /pronto (or /aprovar, /ok).

  4. 4/5

    Video

    After the gate come the costly phases or those with consequences: downloading the avatar video, assembling the reel, and delivering it to the channel. If one fails, /refazer resumes from that phase without redoing the text.

  5. 5/5

    Where to put the gate

    After what needs your eyes, before what is costly or public. A gate at the start has nothing to show; a gate at the end comes too late.

Click each block. The gate goes after the work you need to review and before anything that costs money or goes public.

02Simulate the gate

Run the flow, read the text that stopped at the gate, and decide.

  1. Texts
  2. Gate
  3. Video
  4. Publish

Illustrative browser simulation: nothing is generated or published. The text with the error is intentional.

03Decisions at the gate

Each command does something different. Mixing them up costs work.

1. Approve

/pronto A#9 releases the gate. /aprovar, /aprovado, and /ok are synonyms, and A#9, a9, and A9 refer to the same item.

Without a reference, /pronto releases the flow when only one is waiting; with several, it lists them.

04Flow commands

Practice with | sombra before spending anything.

Telegram · practice, run, and track
/promoavatar Don’t start by learning tools | shadow
# shows stage × audience × queue and does NOT enqueue anything

/promoavatar Don’t start by learning tools --alvo=jovens
/status
/status A#9
Telegram · decide at the gate
/pronto A#9           # approves and continues
/refazer A#9 jovens   # resumes from the stage that failed
/cancelar A#9         # stops the entire flow
/limpar A#9           # shows what it would delete
/limpar A#9 confirmar # actually deletes
flow.json · how the domain declares a gate
{ "id": "plano", "kind": "function", "tarefa": "cli.rodar",
  "comando": "bash {{repo}}/musicavideo.sh plano {{input}} --bruto",
  "pausa_apos": true,
  "portao": { "mostrar": ["{{artefato:plano}}"] } }
Repository example

The stage declares in portao.mostrar what goes to the chat: text goes in the message, audio and images go as files, and video goes as a link (a video lasting several minutes exceeds Telegram’s 50 MB limit).

05Practice

Use a flow with a gate. If /promoavatar isn’t configured yet, start with | shadow.

E5 · The gate

30 min

Run a flow with a gate (such as /promoavatar), first with | shadow to see the stages. When it stops, read what arrived in the chat, make corrections if needed, and only then send /pronto.

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

Domain flows: promoavatar3 (active) and promoavatar (frozen).

06Test what you learned

The explanation appears after your answer.

Question 1 of 4

Where should the gate go in a video flow for social media?skill

To learn more

Previous lessonNext lesson