Skip to main content

Intro and editor

A task is an AI-enabled Python automation hosted in the cloud by qbash. It can run on a schedule, respond to a trigger, or be called through an API or from chat tools using MCP. See Distribution for these options.

The Company brief task with main.py open, company and notes inputs, and its prompt and Markdown document in the file tree

For example, this task passes a company name and some notes to a prompt, then returns a brief:

company = qbash.inputs.get("company")

brief = qbash.ai.run_prompt(
"company-brief",
{"company": company, "notes": qbash.inputs.get("notes", "")},
)

qbash.output({"company": company, "brief": brief})

It uses a company-brief prompt, a required company input, and optional notes. Prompts shows the prompt's instructions and settings.

Iterate with AI​

Close-up of the Iterate with AI button in the task editor toolbar

Iterate with AI gives you access to the qbash development agent, which builds and edits tasks on your behalf. Describe the automation you want, ask for a change, or give it an error to investigate. It can work on the code, prompts, documents, tests, inputs, and settings.

Using the editor​

The file tree on the left opens files in the main workspace, with Resources and Settings below it. The strip above the code shows the task's inputs. Test run asks for their values and opens a console beneath the editor to show what happened.

Task files​

Every task starts with main.py. The Package file menu adds prompts, Markdown documents, tests, and additional Python scripts. All of these files are saved and versioned with the task.

  • main.py runs when the task is called. It reads inputs, calls services or prompts, and controls what happens next. The qbash SDK is already available, with completion for its methods and your other Python files. There is nothing to install or initialize.

  • Prompts hold model instructions and settings. Agent mode lets them use tools, call linked tasks, and delegate work to subagents within the limits you set. They appear as .prompt files and are called by their slug. See Prompts.

  • Markdown documents keep reference text with the code, such as a briefing-guide.md describing what the brief should cover. Code can read or search them; prompts can use them as reference material.

  • tests.py checks Python functions with mocked platform calls. Testing and debugging explains the built-in test runner and how it differs from an editor Test run.

  • Additional Python scripts let you move work out of main.py into separate files. Other scripts and tests can import them as modules.

Inputs​

Inputs define the information a task needs at runtime - for example, a company name and optional meeting notes. Required inputs must be supplied wherever the task is run.

Within the task, retrieve an input with qbash.inputs.get(...):

company = qbash.inputs.get("company")
notes = qbash.inputs.get("notes", "")

The second argument is a fallback when an input is absent. Settings → Inputs defines names, types, required fields, and defaults.

Returning a value​

To return a value from a task, call qbash.output(value). For example:

qbash.output({"company": company, "brief": brief})

The caller receives this result wherever the task was started. You can return text or other JSON-compatible values.

Call it once, usually at the end of main.py. It sets the result without stopping Python execution; code after it still runs.

Resources​

Resources is where you choose what the task can work with: connected accounts, shared memory folders, Secrets, and other tasks. A company brief might need a CRM account for customer details, a memory folder of sales notes, and a separate task that prepares usage figures.

Resources shows Integrations, Secrets, Memory, and Tasks; the Memory panel lets you find and attach shared folders

Attaching a resource makes it available to the task; the code or prompt decides when to use it. The panel highlights resources mentioned in your code that have not been attached yet.

Integrations​

Integrations give the task access to accounts in services such as Pipedrive, Slack, Google Drive, or a database. Select the connection you want it to use - for example, the sales team's CRM account rather than a personal one. Manage opens that service's connections when you need to connect or reauthorize an account.

Your code calls the service through qbash.integrations. qbash uses the selected connection, so you do not need to put its login details in the script. The account's permissions still determine which records and actions are available.

Memory​

Memory attaches shared folders the task can read and search, such as sales notes, product documentation, or company policies. You can select an existing folder or create one here. The task can also add or update documents where its access permits; the folder's permissions and review settings still apply.

These folders can be shared across tasks and chats. For reference text that belongs only to this task, such as its briefing guide, add a Markdown file under Package instead. The SDK reference shows how code reads and searches documents.

Secrets​

Secrets hold sensitive values such as API tokens. Attach an existing Secret or create one here, then refer to it by name - for example, qbash.secrets["SERVICE_TOKEN"] - instead of putting the value in your code. The SDK can use that reference in an authenticated request. Using Secrets covers creation, task access, sharing, and a Python example.

Tasks​

Resources → Tasks attaches other automations this task can call. For example, a company brief could reuse an existing task that calculates account usage. Your code calls it with qbash.tasks.run(...) and uses its result, rather than duplicating its code and settings. Code used only within one task can stay in an additional Python script instead.

To let a prompt use an attached integration, memory folder, or task, pass it to the prompt call. Agent mode can then choose when to use the tools it has been given.

Settings​

Settings contains inputs, triggers, and options such as the timeout, retries, overlapping runs, and data logging.

Triggers configures API access, schedules, webhooks, and connected events, and shows the MCP servers exposing the task. Distribution covers these options and the on-demand run form in qbash.

Saving and versions​

Create Task saves your new task. Each later save creates a version containing the code, prompts, documents, inputs, resources, and settings. Testing an unsaved draft doesn't replace the version used by other callers.

Versions shows who saved each version and when. You can compare changes or restore an earlier version if you need to go back.

A prompt wording change can affect a brief just as much as a code change. When comparing two runs, check their prompt settings and inputs as well as main.py.

Runs and logs​

Logs records how a saved run started, its inputs, status, duration, result, and any errors or retry attempts. For a failed API request or an incorrect brief returned to an AI assistant, open the run to see where the problem occurred.

The available detail depends on Data logging. The code currently open in the editor may have changed since the run, so check its version too. For live feedback while editing a draft, use the run console.

Data logging​

Settings → Details → Data logging controls whether qbash keeps inputs, results, step contents, and error details that may contain business data. With it off, qbash retains operational information about the run but omits that content. It does not remove records already saved.

This controls qbash's history. Connected services and model providers have their own retention settings.

Timeouts and cancellation​

Settings → Details → Timeout limits the task's execution time, including prompt calls, agent work, and connected operations. A prompt's own time limit still sits within the task's overall limit.

When a task is cancelled, a request already in progress may finish before execution stops. Cancellation doesn't undo changes already made in a connected system. Logs show the work recorded so far.

Failures and retries​

Settings → Details → Auto retry enables automatic retries for failed runs. Retries can help with temporary failures, such as a service outage or rate limit. An invalid input or missing permission usually needs a change before another attempt can succeed.

A retry starts main.py again and appears as another attempt in the same run. That means earlier work can repeat, including a message already posted or a record already updated.

Checkpoints let the code reuse work completed by an earlier attempt. Cache can reuse a result across separate runs for a chosen time. Neither automatically makes an external write safe to repeat. The SDK reference explains the distinction and the precautions for duplicate writes.

Overlapping runs​

Settings → Details → Concurrent runs controls whether runs of the same task can overlap. This matters when several callers request a brief at once, especially if the task also updates shared records or uses a service with request limits.

That is separate from processing several items within one run. qbash.parallel(...) handles that case, with its own concurrency, rate-limit, and retry options.