Skip to content
Lucas Lessa
Back to news
DatabricksGAImpact: Medium

Automate analysis with Genie Code tasks in Lakeflow Jobs

Genie Code now runs autonomous natural-language tasks within Lakeflow Jobs, allowing you to automate complex analysis.

What changed

Genie Code tasks let you run an autonomous natural-language agent as part of a Lakeflow job. The agent runs with auto-approval enabled, reads data, calls tools, and returns a link to the resulting chat.

Use cases

Imagine you need to run recurring analyses and generate reports without manual intervention. With this task, you can:

  • Summarize overnight job results and email a report.
  • Analyze incoming data and flag anomalies.
  • Investigate tickets and propose fixes.
  • Generate compliance audit reports.

How to use

In the Lakeflow Jobs UI, add a new task and select the Genie Code type. In the prompt field, enter the natural-language instruction for the agent.

Check the most recent results in the batch_errors table. If error_count is above 5, create a summary of the errors by type and severity, then post a summary to #data-ops Slack channel.

What happens in this code:

  1. The agent reads the recent results from the specified table.
  2. It checks if the error count exceeds the defined threshold of five.
  3. If exceeded, it generates a summary by type and severity.
  4. Finally, it posts the summary to the configured Slack channel.

You can also parameterize the prompt using job parameters:

Summarize yesterday's sales for {{region}} and flag anomalies.

What happens in this code:

  1. Databricks replaces the {{region}} placeholder with the parameter value defined at the job level.
  2. The agent executes the sales analysis targeting the specified region.

Limitations and requirements

  • Generally available (GA).
  • Workspaces must have access to Genie Code agentic capabilities.
  • Auto-approval is always on for job tasks and cannot be disabled.
  • Task prompts must comply with Genie Code usage policies.

Using it in a pipeline

This task can be placed at the end of a data engineering pipeline (Bronze → Silver → Gold) to analyze processed data, send automated reports, or trigger conditional downstream actions.

Read the official Databricks note

Genie Code tasks in Lakeflow Jobs are now generally available

Summary and explanation generated by AI from the official release note. When in doubt, the platform's official documentation prevails.

Related