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:
- The agent reads the recent results from the specified table.
- It checks if the error count exceeds the defined threshold of five.
- If exceeded, it generates a summary by type and severity.
- 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:
- Databricks replaces the
{{region}}placeholder with the parameter value defined at the job level. - 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.
- genie code
- lakeflow jobs
- ai agents
- automation
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
- DatabricksBeta
Screen MCP tool calls for jailbreaks in Unity Gateway
Unity Gateway now lets you screen MCP tool calls and outputs to detect and block jailbreak and prompt injection attempts.
unity gateway · ai gateway - DatabricksBeta
Managed SurveyMonkey connector arrives in Databricks Lakeflow Connect
Lakeflow Connect now features a managed SurveyMonkey connector in Beta, enabling incremental ingestion of surveys, responses, and contacts governed by Unity Catalog.
lakeflow connect · surveymonkey - DatabricksBeta
Lakeflow Connect adds managed Oracle Eloqua connector in Beta
Lakeflow Connect introduces a managed Oracle Eloqua connector in Beta, enabling incremental ingestion of marketing data directly into Unity Catalog.
lakeflow connect · oracle eloqua