Skip to main content

AI Tasks

What is an AI Task?​

An AI Task is a reusable unit of AI work that you define once and run automatically on a schedule or on demand.

Use an AI Task for work that is:

  • Repetitive: it needs to happen regularly (daily, weekly, monthly).
  • Has a clear definition of done: you can describe what a good output looks like.
  • Doesn't need your presence: it can run without you being online.
  • Shared outside Holistics (optional): the result goes to people by email or Slack.

Because the task has explicit acceptance criteria, every run is automatically evaluated (pass or fail), not just generated. This means:

  • Consistent output: the AI follows the same brief every time.
  • Verified results: the output is checked against your criteria before the task is marked complete.
  • Full automation: runs on a schedule without any manual triggering.

Create an AI Task​

Where to create an AI Task​

Go to Development. There are two ways:

  • UI: in the Project Explorer, click Add AI Task.
  • AI chat panel: ask freeform, e.g. "Create a task to summarize last week's sales by region at 8am every Monday and post it to Slack at #sales-all ."
AI Task

What goes into an AI Task​

Below are the essential inputs you'll see on the UI. For advanced settings, see How it works in code.

  • Name (required): The task's unique identifier, e.g. revenue_weekly_insight. Used to reference the task in a schedule or slash command.
  • Label (required): Display name shown in the AI Tasks management page.
  • Description (optional): A short note about what the task does, useful for teammates browsing the list.
  • Brief (required): What you want the AI to complete. You can reference specific dashboards or datasets, and call on AI Skills to guide how the AI approaches the work.
  • Acceptance Criteria (required): What a successful output looks like.

Schedule an AI Task​

An AI Schedule defines when to run which AI Tasks, automatically. When creating an AI Task, you have the option to create a schedule for it.

Admin approval

All scheduled tasks require approval from an Admin before they start running.

What goes into a schedule:

  • Time and frequency (required): When the task runs, e.g. every Monday at 8am, or on the 1st of every month. Follows your workspace timezone setting.
  • Run as (required): The user the task runs as. See "Run as" permission.

Deliver results by email or Slack​

An AI Task can send its result by email or Slack. Add delivery in the brief, and spell out:

  • Where: each email address or Slack channel, written out exactly.
  • What: the content, plus any attachments. You can attach a viz or a dashboard as PDF, PNG, or CSV by email, or as PNG on Slack. Name the exact viz or dashboard and the format.
  • When: on every run, or only when a condition is met (an alert). For an alert, state the condition and what happens otherwise, e.g. "Otherwise, send nothing."

View published AI Tasks​

Go to the AI Tasks page to see all published AI Tasks. The list shows each task's label, associated schedule, last run time, and last run status (running / success / failure).

AI Tasks page

Click a task to see its run history. Each run record includes:

  • Status and timestamps (start time, end time).
  • The trigger type: whether it was run by a schedule or triggered manually.
  • The full output conversation, which you can read and continue from directly.

Run an AI Task​

Run manually​

You can run an AI Task manually in two places:

  • In Development: Use the slash command /task-name in the AI Copilot chat page. Useful for testing and iterating before publishing.
  • In Reporting (after publishing):
    • Click Run on the AI Tasks management page.
    • Use the slash command /task-name in the Ask AI chat page.

Run on schedule​

If an AI Task is configured to run on a schedule, it executes automatically on the configured cadence.

"Run as" permission​

Every run uses one user's permissions, depending on how it's triggered:

  • Manual runs: run as the current user. If the task emails ${H.current_user.h_email}, a manual run sends to you.
  • Scheduled runs: run as the schedule's "Run as" user. If that user is deactivated or deleted before the schedule fires, the run fails.

The AI sees only what the "Run as" user can see. If the task delivers its result, recipients get that user's data, not their own. When choosing a schedule's "Run as" user for a task with delivery:

  • Only you receive it: run as yourself.
  • A group receives it (a Slack channel, a mailing list, or several addresses): recipients could get data they aren't allowed to see, or miss data they need. Pick a user whose access suits every recipient, or send each recipient their own version.
  • Each recipient gets their own version: email ${H.current_user.h_email} in the delivery step, and add one schedule per recipient with that recipient as "Run as". See this example.

Test runs really send emails and Slack messages. While testing, point delivery at your own email or a test channel, then switch to the real recipients.

How it works in code​

AI Task and AI Schedule are independent building blocks: one task can be targeted by multiple schedules, and one schedule can run multiple tasks.

AiTask and AiSchedule
  • When you create an AI Task, an AiTask is created in an .ai_task.aml file under settings/ai/tasks/.
  • When you schedule an AI Task, an AiSchedule is created in the schedules.aml file.

AiTask definition in code:

AiTask name {
label:
description (optional):
brief:
acceptance_criteria:
timeout_minutes (optional):

// Advanced settings:
output_schema (optional):
branch (optional):
}

Advanced settings not covered above:

  • Output Schema (optional): A JSON schema defining the expected structure of the output. Use this when you need the result in a specific format, for example when a downstream system needs to parse it.
  • Branch (optional, default: production): Which version of your data model the AI works against. 'Development' is coming soon.

AiSchedule definition in code:

Each AiSchedule is an item in the schedules list in schedules.aml. When the list has more than one schedule, separate them with a comma:

const schedules = [
AiSchedule {
cron: '0 8 * * 1' // every Monday at 08:00
targets: [weekly_sales_report]
},
AiSchedule {
cron: '0 9 1 * *' // the 1st of every month at 09:00
targets: [order_return_anomaly_check, ai_chat_insights_rollup]
}
]
  • cron: when the schedule runs, as a cron schedule expression.
  • run_as: the email of the user the tasks run as.
  • targets: one or more AiTasks to run.

AI Task vs. AI Skill​

What's the difference​

If you're already using AI Skills, here's how a Task is different.

AI SkillAI Task
What it isInstructions on how the AI should approach the workDefines what the AI should complete, with a clear definition of "done"
When to useYou want consistent answers for repetitive workYou have repetitive work to complete, need the output verified (not just generated), or have a potential need for automation

Example

  • AI Task: Summarize last week's revenue by region and flag anomalies.
    • Definition of done: produced a correct summary with relevant anomalies flagged.
  • AI Skill: How to calculate revenue, how to detect anomalies.
  • AI Schedule: Run this Task every Monday morning.

Using them together​

Many times AI Task and AI Skill are meant to use together, not chosen between. Pick whichever matches how the work shows up, then let it evolve. There's no wrong starting point.

  • Start with a Skill for a way of working that applies across many jobs: team conventions, formatting rules, or a workflow you repeat often. E.g., "how to compute a P&L" or "always use ISO week for time periods."
  • Start with a Task when you already know the specific job and what "done" looks like. E.g., "summarize last week's revenue by region and flag anomalies, every Monday."
  • Task → Skill: when the same instructions keep showing up across multiple Task briefs, extract them into a Skill so future Tasks can just reference it.
  • Skill → Task: when you keep invoking the same Skill for the same outcome on a regular basis, wrap it in a Task with a definition of done (and a Schedule if it needs to run unattended).
  • A Task can call a Skill, not the reverse: a Task's brief can invoke existing Skills to guide how the AI approaches the work, but a Skill can't kick off a Task on its own — someone still has to assign the job.

Examples​

Weekly report by email​

Every Monday at 8am, email last week's sales summary to the CEO and CFO, with a chart and the category breakdown attached.

// settings/ai/tasks/weekly_sales_report.ai_task.aml
AiTask weekly_sales_report {
label: 'Weekly sales report'
description: 'Weekly sales summary for the CEO and CFO, with a revenue chart and category breakdown.'

brief: @md
1. From the `ecommerce` dataset, get `revenue`, `total_orders`, and `aov` for last week (the last complete Monday to Sunday week) and for the week before.
2. Break `revenue` down by product category for both weeks, and find the 3 categories with the largest absolute change.
3. Write a summary of at most 150 words: the three headline metrics with their week-over-week % change, then the top 3 movers, each with a one-line likely reason.
4. Create a bar chart of revenue by category, comparing last week with the week before.
5. Delivery: Email the summary to [email protected] and [email protected], with the chart attached as PNG and the category breakdown attached as CSV. Subject: "Weekly sales summary - week of <Monday's date>".
;;

acceptance_criteria: @md
- Revenue, total orders, and AOV are reported for last week, each with its week-over-week % change.
- Exactly 3 top-moving categories are listed.
- The email was sent to both recipients with the PNG chart and the CSV attached.
;;
}

// schedules.aml
const schedules = [
AiSchedule {
cron: '0 8 * * 1' // every Monday at 08:00
targets: [weekly_sales_report]
}
]

Both recipients get what [email protected] can see, so pick a "Run as" user whose access suits both.

Slack alert when a condition is met​

Every morning, post to #sales on Slack if any country's revenue dropped 20% or more compared with the same weekday last week. On other days, nothing is sent.

// settings/ai/tasks/revenue_drop_alert.ai_task.aml
AiTask revenue_drop_alert {
label: 'Revenue drop alert'
description: 'Alerts #sales when a country with meaningful revenue drops 20% or more week over week.'

brief: @md
1. From the `ecommerce` dataset, get `revenue` by country for yesterday and for the same weekday one week earlier.
2. Ignore countries whose revenue a week earlier was under $1,000.
3. Find every remaining country whose revenue dropped 20% or more.
4. If any country qualifies, write an alert: one line per country with both revenue values and the % change, sorted by largest drop.
5. Delivery: If at least one country dropped 20% or more, post the alert to #sales on Slack. Otherwise, send nothing, and state in the run output that no country crossed the threshold, with the largest drop found.
;;

acceptance_criteria: @md
- Every country with revenue of at least $1,000 a week earlier was checked.
- If any country dropped 20% or more, the alert lists all of them with both values and the % change, and was posted to #sales.
- If none did, nothing was posted, and the run output says no country crossed the threshold and shows the largest drop found.
;;
}

// schedules.aml
AiSchedule {
cron: '0 7 * * *' // every day at 07:00
targets: [revenue_drop_alert]
}

Step 2 sets a minimum base, so small countries that swing 20% on a few orders don't trigger the alert.

Weekly semantic layer gaps from AI chat insights​

Every Friday at 5pm, send the data team the top 5 gaps in the semantic layer that users' AI questions hit this week.

// settings/ai/tasks/semantic_layer_gaps_weekly.ai_task.aml
AiTask semantic_layer_gaps_weekly {
label: 'Semantic layer gaps weekly'
description: 'Top 5 semantic layer gaps from the past 7 days of AI chat Suggestions, for the data team.'

brief: @md
1. Review the AI chat Suggestions from the past 7 days.
2. Group Suggestions that describe the same gap, e.g. the same dataset missing the same metric or dimension.
3. Rank the groups by number of conversations, and keep the top 5.
4. For each group, write: the affected dataset or model, the gap in one sentence, the number of conversations, and the proposed fix, quoted from the original Suggestion.
5. Delivery: Post the list to #data-team on Slack, and email it to [email protected].
;;

acceptance_criteria: @md
- At most 5 groups, sorted by conversation count.
- Every group names the affected object and includes a fix quoted from a real Suggestion.
- The result was posted to #data-team and emailed to [email protected].
;;

timeout_minutes: 30
}

// schedules.aml
const schedules = [
AiSchedule {
cron: '0 17 * * 5' // every Friday at 17:00
targets: [semantic_layer_gaps_weekly]
}
]

The Suggestions come from AI Chat Insights. This task does multi-step analysis, so it raises timeout_minutes to 30.

One report per recipient, scoped to their data​

Every Monday, email each regional manager (APAC, Americas, and EU) their own region's sales.

// settings/ai/tasks/regional_sales_weekly.ai_task.aml
AiTask regional_sales_weekly {
label: 'Regional sales weekly'
description: 'Weekly sales summary, emailed to each regional manager with their own data.'

brief: @md
1. From the `ecommerce` dataset, get `revenue` and `total_orders` for last week (the last complete Monday to Sunday week) and for the week before, broken down by country.
2. Write a summary with the region's totals, their week-over-week % change, and the 3 countries with the largest change.
3. Delivery: Email the summary to ${H.current_user.h_email}.
;;

acceptance_criteria: @md
- The region's revenue and total orders are reported for last week, each with its week-over-week % change.
- The 3 countries with the largest change are listed.
- The email was sent to the run's "Run as" user.
;;
}

// schedules.aml: one schedule per manager, each with that manager as run_as
const schedules = [
AiSchedule {
cron: '0 8 * * 1'
targets: [regional_sales_weekly]
},
AiSchedule {
cron: '0 8 * * 1'
targets: [regional_sales_weekly]
},
AiSchedule {
cron: '0 8 * * 1'
targets: [regional_sales_weekly]
}
]

${H.current_user.h_email} resolves to the email of each run's "Run as" user, so the same task sends each manager their own report. This relies on each manager's data permissions limiting them to their region. If they don't, filter by region in the brief instead.


Open Markdown
Let us know what you think about this document :)