Edit an offline computing task
You can use natural language commands to instruct code agents, such as Qoder and CodeX, to modify an existing offline computing task, including its task code, scheduling configuration, data source, and upstream and downstream dependencies. This topic describes the features, prerequisites, and examples of this capability. An appendix also provides a list of input parameters.
Features
This feature lets you modify the configuration of existing offline tasks in the development environment using natural language commands. Common modifications include adjusting task code, modifying the scheduling cycle and cron expression, switching the data source, configuring a task to run at continuous intervals all day, and adjusting the node output name, priority, runtime parameters, and upstream dependency. Before editing, the agent typically locates the task by its name and reads its current configuration as a baseline before applying the requested changes.
Use cases:
-
Modify the
task codeorscheduling configurationof an existing offline computing task. -
Switch the
data source, database name, or catalog for SQL-based tasks. -
Change a task's schedule to run at minute-level intervals or adjust its
cron expression. -
Adjust a task's
upstream dependency, node output name,priority, orruntime parameters.
Limitations: Edit operations update the task configuration only in the development environment. The task type cannot be changed. To change the type, you must delete the task and then recreate it. To apply changes to the production environment, you must submit and publish them. Every edit completely overwrites the upstream dependencies. To avoid removing dependencies, you must provide the complete list with each edit.
Prerequisites
-
The target Dataphin project exists, and you are a member of the project.
-
The target offline computing task has been created in the development environment and can be found by its name.
-
Have the new content ready, such as the updated
task code,scheduling configuration, or dependency information. -
When editing a database SQL task, have the target
data sourceinformation ready. In projects with dual development and production environments, you typically need to use a productiondata source.
Examples
Describe your requirements to the agent in natural language. The following are example commands:
-
"Change the code for this task to
select * from demo01." -
"Help me change the schedule for this task to run every 5 minutes all day."
-
"Switch the
data sourcefor this SQL task to another PostgreSQLdata source." -
"Add an
upstream dependencyto this task that depends on theshell_atask."
Interaction steps:
-
The agent first locates the task by its name within the project directory. If any information is missing, the agent prompts you for it.
-
The agent typically reads the task's current configuration as a template and then applies the modifications based on your request.
-
When editing an
upstream dependency, the agent overwrites the entire list with the one you provide. To prevent data loss, always supply the complete dependency list. -
After the modifications are complete, the agent informs you that it applied the changes only to the development environment. To deploy them to production, you need to submit and publish the task.
Input parameters
The following table lists the input parameters for editing an offline computing task. The agent automatically identifies required parameters from your commands and prompts for any missing details. You do not need to provide system-generated parameters, which are marked as not required.
|
Parameter |
Required |
Description |
Example |
|
tenant ID |
Yes |
The identifier for the Dataphin tenant where the operation is performed. |
1234567890123456789 |
|
project ID |
Yes |
The Dataphin project to which the task belongs. |
— |
|
Task name |
Yes |
The name of the offline computing task to edit. The agent uses this name to locate the task. |
cli_test |
|
task type |
Yes |
The type of task. This must match the original |
Shell |
|
task code |
No |
The new content of the |
select * from demo01 |
|
scheduling cycle |
Conditionally required |
Required when you modify the schedule, for example, daily, hourly, or every minute. |
Every minute |
|
cron expression |
Conditionally required |
Required when you modify the schedule. Defines the specific time when the task is triggered. |
Daily at 00:00 |
|
data source |
Conditionally required |
Provide this when you switch the |
— |
|
Upstream dependency |
No |
The complete list of the task's upstream dependencies. This is completely overwritten during an edit. |
shell_a |
|
priority |
No |
The scheduling |
5 |