Why use Workflows?
Agents equipped with tool-calling are becoming more popular due to their flexibility. This flexibility comes at a cost though — they often spend a lot of time viewing files, running bash commands, and checking their work. Using a hand-crafted workflow requires more iteration on prompting & orchestration, but it can be many times faster. For prompt-to-app products, where latency can cause significant user frustration, the workflow approach is a strong option.Prompt Guide
When using Instant Apply with workflows, you should include the instructions for the formatting of the edit snippet somewhere in your system prompt. Here’s a prompting structure we’ve seen work well with Claude 4 Sonnet:System Prompt
User Prompt
Troubleshooting
Depending on the complexity of your system prompt, you may need to adjust the placement or structure of the snippet generation instructions. We recommend using the Anthropic workbench or the OpenAI playground to iterate on your prompt until a few examples work. The goal is to strike a balance between brevity and contextualization of the// ... rest of code ... placeholders.