Skip to main content
A routine is a Python file with a Config class and an async run function. Condor runs it directly: it fetches data, computes what you asked for and returns a result or saves a report. No LLM reads the code or interprets the output while it runs, so the same input gives the same output and a run costs no tokens. Use a routine for work you want done the same way every time: scans, indicators, price checks, bot summaries, backtest charts. Use a skill when the work needs judgment.

Routines and skills

Where routines live

Who can run a routine depends on which folder it’s in. <condor> is the folder you installed Condor into.
To give a routine to every agent, put it in .condor/agents/_shared/routines/. The .condor/ folder is ignored by git, so git pull and /update leave it alone.
When two folders hold a routine with the same name, the more specific one wins:
  • An agent’s own routine shadows a shared routine with the same name.
  • For the chat, a routine in .condor/agents/condor/routines/ shadows a shared or shipped one.
  • A routine in .condor/agents/ shadows the shipped copy in agents/.
To change a shared routine for one agent only, create a routine with the same name in that agent’s routines/ folder. See Architecture for how agent folders work.

A minimal routine

  • The file name is the routine’s name. Save this as price_check.py and it appears as price_check.
  • The first line of the Config docstring is the routine’s description. It shows on the routine’s card and in the list agents see.
  • Each Field(description=...) labels a setting in the Workspace config form and in Telegram.
  • get_client(chat_id, context=context) returns a Hummingbot API client for the server the run was started on.
Never put an API key, password or private key in a Config default. Routine definitions are visible to every user of the install, and Condor refuses to load a routine whose defaults look like a credential. Read secrets inside run() from the environment instead.

What run returns

run(config, context) can return either:
  • A string. Shown in Telegram and in the Workspace’s Output view.
  • A RoutineResult. It has a text field for Telegram and optional fields the Workspace renders: table_data and table_columns, a chart_image (PNG bytes) and sections.
A routine can also save an HTML report with charts and tables. See Reports.

One-shot and continuous routines

  • One-shot routines run once and return. You can run them on demand or on a schedule.
  • Continuous routines set CONTINUOUS = True at module level. They loop until you stop them, and they handle their own timing with asyncio.sleep. When stopped, Condor cancels the task, so catch asyncio.CancelledError and return a closing message. Continuous routines can’t be scheduled.
The shipped price_monitor routine is continuous. It keeps a live report up to date while it runs. Creating Routines has a full example.

Optional module attributes

Running routines

When an agent runs a loop, its prompt lists every routine it can run, with each routine’s description. A Dry Run refuses routine runs, because a routine can run any Python. Listing routines and reading their source still work.

No restart needed

Condor checks the routine folders each time it lists routines, and reloads only files whose modification time changed. A new or edited file shows up the next time you open the Routines page, open /routines in Telegram, or an agent lists its routines. Routines inside an agent you imported, for example from the Agent Hub, stay pending until you allow them in that agent’s Routines tab. Routines you create yourself load as above. Telegram’s 🔄 Reload button forces a full reload. Use it to retry a file that failed to load.

Let Condor write routines

You can describe a routine in the chat and Condor writes it, loads it and runs it to test it:
Condor saves routines it writes to .condor/agents/condor/routines/, which git ignores. To make one available to every agent, ask Condor to publish it as shared, which saves it to .condor/agents/_shared/routines/. An agent that writes a routine saves it to its own routines/ folder.

Next steps

Creating Routines

Write, test and use your own routines

Built-in Routines

The routines that ship with Condor

Reports

Save HTML reports with charts and tables

Routines page

Run, schedule and browse reports in the Workspace