Overview

Tool Name

delegate_work

Purpose

The delegate_work tool orchestrates sophisticated work delegation across specialized data agents. Use it to assign tasks with retries and timeouts, launch deep analytical workflows, execute predefined programs, and repeat instructions across multiple items while preserving progress, status, and results.

Functions Available

  1. _delegate_work: Assign a task to a target data agent with optional retries, timeouts, and callback wiring.
  2. deep_analysis: Run a guided multi-step analysis with optional human-in-the-loop checkpoints.
  3. run_program: Execute a predefined program such as mapping research or DBT model build.
  4. repeat: Iterate the same instruction across a list of items with per-item controls.

Key Features

Targeted Delegation

Route well-scoped tasks to the right specialist agent and capture structured results.

Deep Analysis

Drive multi-step investigations with optional interactive checkpoints.

Program Execution

Launch opinionated programs for mapping, research, and DBT model building.

Batch Operations

Repeat instructions across up to 20 items with per-item retry and timeout.

Reliability Controls

Built-in retry, timeout, and progress reporting for resilient automation.

Input Parameters for Each Function

_delegate_work

NameDefinitionFormat
target_botData Agent id or name to receive the task.String (required)
promptClear task description and instructions.String (required)
timeout_secondsMax seconds to wait for completion. Default 300.Integer
max_retriesNumber of automatic retries on transient failure.Integer

deep_analysis

NameDefinitionFormat
questionBusiness or technical question to analyze.String (required)
modelModel hint, for example o4-mini or gpt-4.String
interactive_modeEnable human prompts at checkpoints.Boolean
max_stepHighest step to execute, 1 to 5.Integer
stop_atNamed step to stop after: business_terms, research, generation, execution, formatting.String
verbosityOutput verbosity: minimal, standard, debug.String
show_full_outputReturn complete workflow output. Default true.Boolean
resume_taskTask id to resume a paused run.String
user_answersAnswers to pending prompts when resuming.String
output_fileFile path to save full results as JSON.String

run_program

NameDefinitionFormat
program_idProgram to run: mapping_research_and_proposal, create_mappings_project, create_mappings_project_from_json, dbt_model_build.String (required)
project_idProject id for the program.String
todo_idTodo id for mapping research.String
root_folderRoot folder for generated assets.String
g_sheet_idGoogle Sheet id for configuration.String
json_config_pathPath to JSON configuration file.String
dbt_profileDBT profile name for model build.String
dbt_projectDBT project name for model build.String
target_schemaTarget schema for DBT models.String
requirements_table_nameFull path to requirements table for DBT.String

repeat

NameDefinitionFormat
instructionBase instruction to apply to every item.String (required)
itemsArray of up to 20 parameter objects.Array (required)
timeout_secondsMax seconds per item.Integer
max_retriesRetry attempts per item.Integer

Use Cases

  1. Cross-agent project orchestration Delegate profiling to a data agent, documentation to a writer agent, and ticketing to a PM agent, then roll up results.
  2. Interactive business analysis Use deep_analysis with interactive_mode to validate assumptions and decisions with stakeholders.
  3. Programmatic DBT workflows Run dbt_model_build via run_program and persist outputs for review.
  4. High-volume batch tasks Apply the same instruction to many datasets with repeat, capturing per-item outcomes.
  5. Research and mapping initiatives Launch mapping_research_and_proposal and generate a project skeleton with linked artifacts.

Workflow/How It Works

  1. Plan the delegation: define scope, success criteria, and the right target agent or program.
  2. Invoke _delegate_work, deep_analysis, run_program, or repeat with appropriate controls.
  3. Monitor progress through step outputs and status messages.
  4. Resolve prompts in interactive mode when decisions are required.
  5. Capture results, artifacts, and logs for audit and follow-up actions.

Integration Relevance

  • make_baby_bot to create and manage specialist data agents used as targets.
  • project_manager_tools to track delegated work as tasks and milestones.
  • data_connector_tools to power data retrieval inside delegated analyses.
  • dbt_action to coordinate model builds from run_program.
  • google_drive_tools and file_manager_tools to persist configurations and outputs.
  • slack_tools to notify owners when delegated tasks complete or fail.

Configuration Details

  • Ensure target agents are online and authorized for the requested operations.
  • Match program_id and required configs exactly when using run_program.
  • Choose interactive_mode only when a human can respond to prompts in a timely manner.
  • Calibrate timeouts and retries to expected task durations and external dependency behavior.
  • Store any generated files in a consistent location for downstream indexing or sharing.

Limitations or Notes

  1. Success depends on target agent’s availability and capability.
  2. Interactive runs may pause indefinitely without user input.
  3. repeat accepts at most 20 items to protect resources.
  4. Some programs require external credentials or configuration files.
  5. Model choice in deep_analysis influences quality and cost.
  6. Network or API outages can cause timeouts even with retries.

Output

  • Delegation responses with final status, data payloads, and any generated artifact references.
  • Deep analysis reports including step logs, findings, and recommendations.
  • Program outputs such as created projects, file paths, or DBT build summaries.
  • Batch results for repeat, one entry per item with success or failure details.
  • Interactive prompts when human input is needed, plus resume tokens for later continuation.
  • Error messages with retry counts and hints for remediation.