write_tasks
Create, update, or delete data replication tasks within CData Sync jobs to define what data to synchronize using exact table names and SQL queries.
Instructions
Manage tasks within jobs. Tasks define what data to replicate.
IMPORTANT: Use exact table names from get_connection_tables, including file extensions.
RETURNS:
create: New task with assigned TaskId
update: Creates new task (cannot modify existing)
delete: Confirmation of task removal
COMMON ERRORS:
"Invalid table name" - Use exact name from get_connection_tables
"Task not found" - Verify TaskId with read_tasks
"Invalid query syntax" - Check SQL syntax for provider
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Operation: create new, update (actually creates new!), or delete existing task | |
| jobName | Yes | Job name containing the task (required). Job must exist. | |
| taskId | No | Task ID as string for update/delete. Use exact value from read_tasks - don't convert numbers. | |
| tableName | No | Exact table name as returned by get_connection_tables. Include file extensions for file-based sources (e.g., 'Account.csv' not 'Account'). Case-sensitive. Automatically creates REPLICATE query. | |
| query | No | SQL query for the task. Use 'REPLICATE [TableName]' for full table using exact source names, or write custom SQL with filters/joins. ⚠️ IMPORTANT: For flat files, always wrap table names in brackets to handle periods correctly: 'REPLICATE [Account.csv]' NOT 'REPLICATE Account.csv' | |
| index | No | Execution order (1, 2, 3...). Tasks run sequentially by index unless parallel processing enabled. | |
| workspaceId | No | Workspace ID to use for this operation. Overrides the default workspace. Use 'default' for the default workspace or a UUID for specific workspaces. |