Märkus.
Juurdepääs sellele lehele nõuab autoriseerimist. Võite proovida sisse logida või kausta vahetada.
Juurdepääs sellele lehele nõuab autoriseerimist. Võite proovida kausta vahetada.
Use the Genie Code task to run an autonomous agent as part of a job. Genie Code works from a natural-language prompt and runs with auto-approve.
Important
This feature is in Beta. Workspace admins can control access to this feature from the Previews page. See Manage Azure Databricks previews.
Overview
The Genie Code task type launches a new Genie Code chat with your prompt and produces a response. Genie Code reads data, calls tools, and acts on your prompt without requiring additional input or approval. After the run completes, you can open the chat and continue to interact with Genie Code.
Use a Genie Code task when you want to automate complex analysis, data operations, or decision-making as part of a scheduled job. For example:
- Summarize overnight job results and email a report.
- Analyze incoming data and flag anomalies.
- Investigate a Jira ticket and propose a fix.
- Generate a weekly compliance audit.
Requirements
- Your workspaces must have access to Genie Code's agentic capabilities. See Requirements.
- Your task prompt must comply with Genie Code usage policies.
Configure a Genie Code task
Note
The jobs UI displays options dynamically based on other configured settings.
To add a Genie Code task:
- Navigate to the Tasks tab in the Jobs UI.
- Click
Add task.
- Enter a name into the Task name field.
- In the Type drop-down menu, select
Genie Code.
Configure the prompt
Enter a natural-language prompt in the Prompt field. The prompt describes what you want the agent to do when the task runs. For example:
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.
(Optional) Configure parameters
To reuse one prompt across runs with different values, reference job parameters in the prompt. Job parameters are pushed down to the task automatically, so you do not configure parameters on the task itself.
- Define job parameters as key-value pairs on the job, using Edit parameters in the Job details sidebar. See Configure job parameters.
- In the prompt, reference a parameter with
{{name}}, wherenameis the job parameter's key.
For example, with a job parameter named region:
Summarize yesterday's sales for {{region}} and flag anomalies.
When the task runs, Azure Databricks replaces each {{name}} placeholder with the parameter's value. A placeholder with no matching parameter is left unchanged. A job parameter's value can be a static value or a dynamic value reference, such as an upstream task's value. See Dynamic value references.
Finalize job configuration
- (Optional) To configure retries, run-duration or streaming-backlog thresholds, or notifications, see Advanced task settings.
- Click Save task.
To edit, clone, disable, or delete this task, see Configure and edit tasks in Lakeflow Jobs.
How Genie Code job tasks work
Autonomous execution with auto-approval
When a Genie Code task runs, the agent executes your prompt autonomously. Auto-approval is always on for job tasks, so you do not confirm tool calls during the run. The agent uses an AI classifier to check each action against your prompt and blocks risky operations that fall outside the intended scope.
To understand how auto-approval works and its limits, see Approve tool actions.
Warning
Auto-approve is a productivity feature, not a security boundary, and you cannot disable it for a job task. Because the task runs unattended, be deliberate about what production data, sensitive workspaces, or shared resources the prompt can reach.
Reading upstream task outputs
The agent can read the outputs of upstream tasks in the same job as part of its work. Describe the upstream data you want it to use in your prompt, and the agent retrieves the relevant task outputs during the run.
Genie Code settings and MCP connections
The task inherits your Genie Code settings and any custom Model Context Protocol (MCP) connections you have configured. The agent has access to the same tools and data sources you would use in an interactive Genie Code session.
Output
Each task run produces a continuable Genie Code conversation thread. When the task completes, the Run output displays a link to the conversation, the task prompt, and the latest response. Click the link to open the thread and review what the agent did, ask follow-up questions, or continue the work interactively.
Limitations
- Auto-approval cannot be disabled: Job tasks always run with auto-approval on. You cannot turn it off or review actions before they execute.
Additional resources
- Configure and edit tasks in Lakeflow Jobs: Configure and edit tasks in Lakeflow Jobs.
- Use Genie Code: Learn how to use Genie Code in general.
- Genie Code scheduled tasks: Schedule Genie Code prompts to run on a recurring basis. A scheduled task runs interactively and produces a chat in your chat list, while a Genie Code job task runs as part of a job workflow.