Script your AI agent with custom message workflows for precise control
Take complete control over the Cloud Coding API by scripting your AI agent’s exact behavior. Custom messages let you define precise conversation flows, control tool usage, and create powerful development workflows that adapt to your specific needs.
New to Cloud Coding API? Start with prebuilt templates for quick results, then return here when you need complete control over AI behavior.
Define your own custom workflow instead of using prebuilt templates:
Custom messages give you the same AI capabilities as prebuilt templates, but with complete control over the conversation flow and execution steps.
Prebuilt Templates | Custom Messages |
---|---|
❌ Fixed workflows | ✅ Script any workflow |
❌ Limited tool control | ✅ Choose tools per step |
❌ Repository-wide scope | ✅ Directory-focused work |
❌ Template variables only | ✅ Full conversation control |
❌ Predefined steps | ✅ Custom workflow logic |
Every message supports these fields:
Critical Limitation: You cannot change workingDir
and use continueConversation: true
in the same request. When changing directories, you must start a fresh conversation (omit continueConversation
or set it to false
).
Start with simple, focused tasks:
Chain related tasks together:
Precisely control which tools are used at each step:
Break down complex tasks into manageable steps:
Important: This example shows an incorrect pattern. You cannot change workingDir
and use continueConversation: true
. Each directory requires a separate API call.
Focus the agent on specific parts of your codebase using separate API calls:
Based on the actual system capabilities, you can specify these tools:
Tool | Purpose | Use When |
---|---|---|
"all" | All available tools | Most scenarios (recommended) |
"Task" | Task management and planning | Project planning and organization |
"Bash" | Execute shell commands | Running tests, builds, deployments |
"Glob" | File pattern matching | Finding files with specific patterns |
"Grep" | Text search and matching | Searching for code patterns |
"LS" | Directory listing | Exploring project structure |
"Read" | Read file contents | Understanding existing code |
"Edit" | Edit existing files | Modifying code |
"MultiEdit" | Edit multiple files | Large refactoring tasks |
"Write" | Create new files | Adding new components/modules |
"NotebookRead" | Read Jupyter notebooks | Data science projects |
"NotebookEdit" | Edit Jupyter notebooks | Data science workflows |
"WebFetch" | Fetch web content | Getting external documentation |
"TodoRead" | Read todo lists | Project management |
"TodoWrite" | Manage todo lists | Task tracking |
"WebSearch" | Search the web | Finding solutions and documentation |
Complete feature implementation from planning to deployment:
Comprehensive security review and fixes:
Large-scale TypeScript migration using directory-focused approach:
Single-directory focused refactoring:
Focused database work:
Use continueConversation: true
to maintain context across messages:
Use workingDir
to focus the agent on specific parts of your repository:
Note: The example below shows an incorrect pattern - you cannot change workingDir
and use continueConversation: true
together.
Critical Technical Constraint: The Cloud Coding API has an important limitation when using workingDir
:
workingDir
changes with continueConversation: true
This limitation is enforced at the system level and cannot be worked around.
Then evolve to:
❌ Vague: "Fix the code"
✅ Specific: "Add error handling to all API endpoints, including proper HTTP status codes and user-friendly error messages"
Pattern | Use Case | Implementation | Example |
---|---|---|---|
Single Message | Simple, focused tasks | One message, any directory | Add dark mode toggle |
Multi-Step | Related task sequence in same scope | Multiple messages with continueConversation: true | Plan → Implement → Test |
Tool-Controlled | Specific operations with controlled tool access | Messages with specific tool arrays | Read-only analysis, then targeted editing |
Task Planning | Complex feature development | Analysis → Implementation → Testing flow | Plan → Implement → Test → Deploy |
Single Directory Focus | Work within one directory | workingDir + multi-step messages | Component library refactoring |
Multi-Directory | Large codebase work across directories | Separate API calls (cannot use continueConversation ) | TypeScript migration per directory |
Critical Pattern Limitation: Multi-directory workflows must use separate API calls. You cannot change workingDir
and use continueConversation: true
in the same request. This is a system-level constraint, not a documentation suggestion.
Ready to build your first custom workflow? Start with:
continueConversation: true
workingDir
for targeted developmentCustom messages give you the power to script any development workflow. Start simple and gradually build more sophisticated automation as you learn the patterns.
Script your AI agent with custom message workflows for precise control
Take complete control over the Cloud Coding API by scripting your AI agent’s exact behavior. Custom messages let you define precise conversation flows, control tool usage, and create powerful development workflows that adapt to your specific needs.
New to Cloud Coding API? Start with prebuilt templates for quick results, then return here when you need complete control over AI behavior.
Define your own custom workflow instead of using prebuilt templates:
Custom messages give you the same AI capabilities as prebuilt templates, but with complete control over the conversation flow and execution steps.
Prebuilt Templates | Custom Messages |
---|---|
❌ Fixed workflows | ✅ Script any workflow |
❌ Limited tool control | ✅ Choose tools per step |
❌ Repository-wide scope | ✅ Directory-focused work |
❌ Template variables only | ✅ Full conversation control |
❌ Predefined steps | ✅ Custom workflow logic |
Every message supports these fields:
Critical Limitation: You cannot change workingDir
and use continueConversation: true
in the same request. When changing directories, you must start a fresh conversation (omit continueConversation
or set it to false
).
Start with simple, focused tasks:
Chain related tasks together:
Precisely control which tools are used at each step:
Break down complex tasks into manageable steps:
Important: This example shows an incorrect pattern. You cannot change workingDir
and use continueConversation: true
. Each directory requires a separate API call.
Focus the agent on specific parts of your codebase using separate API calls:
Based on the actual system capabilities, you can specify these tools:
Tool | Purpose | Use When |
---|---|---|
"all" | All available tools | Most scenarios (recommended) |
"Task" | Task management and planning | Project planning and organization |
"Bash" | Execute shell commands | Running tests, builds, deployments |
"Glob" | File pattern matching | Finding files with specific patterns |
"Grep" | Text search and matching | Searching for code patterns |
"LS" | Directory listing | Exploring project structure |
"Read" | Read file contents | Understanding existing code |
"Edit" | Edit existing files | Modifying code |
"MultiEdit" | Edit multiple files | Large refactoring tasks |
"Write" | Create new files | Adding new components/modules |
"NotebookRead" | Read Jupyter notebooks | Data science projects |
"NotebookEdit" | Edit Jupyter notebooks | Data science workflows |
"WebFetch" | Fetch web content | Getting external documentation |
"TodoRead" | Read todo lists | Project management |
"TodoWrite" | Manage todo lists | Task tracking |
"WebSearch" | Search the web | Finding solutions and documentation |
Complete feature implementation from planning to deployment:
Comprehensive security review and fixes:
Large-scale TypeScript migration using directory-focused approach:
Single-directory focused refactoring:
Focused database work:
Use continueConversation: true
to maintain context across messages:
Use workingDir
to focus the agent on specific parts of your repository:
Note: The example below shows an incorrect pattern - you cannot change workingDir
and use continueConversation: true
together.
Critical Technical Constraint: The Cloud Coding API has an important limitation when using workingDir
:
workingDir
changes with continueConversation: true
This limitation is enforced at the system level and cannot be worked around.
Then evolve to:
❌ Vague: "Fix the code"
✅ Specific: "Add error handling to all API endpoints, including proper HTTP status codes and user-friendly error messages"
Pattern | Use Case | Implementation | Example |
---|---|---|---|
Single Message | Simple, focused tasks | One message, any directory | Add dark mode toggle |
Multi-Step | Related task sequence in same scope | Multiple messages with continueConversation: true | Plan → Implement → Test |
Tool-Controlled | Specific operations with controlled tool access | Messages with specific tool arrays | Read-only analysis, then targeted editing |
Task Planning | Complex feature development | Analysis → Implementation → Testing flow | Plan → Implement → Test → Deploy |
Single Directory Focus | Work within one directory | workingDir + multi-step messages | Component library refactoring |
Multi-Directory | Large codebase work across directories | Separate API calls (cannot use continueConversation ) | TypeScript migration per directory |
Critical Pattern Limitation: Multi-directory workflows must use separate API calls. You cannot change workingDir
and use continueConversation: true
in the same request. This is a system-level constraint, not a documentation suggestion.
Ready to build your first custom workflow? Start with:
continueConversation: true
workingDir
for targeted developmentCustom messages give you the power to script any development workflow. Start simple and gradually build more sophisticated automation as you learn the patterns.