Dev Agent Workflows
Workflows allow you to define a series of steps to guide Dev Agent through repetitive Salesforce development tasks, such as deploying components, running tests, or creating releases. To invoke a workflow in your workspace, type /[workflow-name.md]
in the chat. Workflows transform how you handle repetitive Salesforce development tasks by creating reusable, automated sequences. Instead of manually performing the same steps repeatedly, you can define workflows once and trigger them with a simple command.
Key benefits:
- Automate repetitive tasks: Deploy components, run tests, create releases with one command
- Ensure consistency: Follow the same process every time
- Reduce errors: Eliminate manual steps that can be forgotten or done incorrectly
- Save time: Turn multi-step processes into single commands
- Share processes: Team members can use the same proven workflows
Common Salesforce workflow types:
- Deployment workflows: Deploy and validate components across orgs
- Testing workflows: Run comprehensive test suites and analyze results
- Release workflows: Package and deploy releases with proper validation
- Component workflows: Create, test, and deploy new Lightning components
- Integration workflows: Set up and validate external integrations
Quickly create workflows through Dev Agent's built-in interface.
- Access Workflow Tab: Click Rules & Workflows (justice icon) in the Dev Agent chat interface.
- Choose Workflow Type: Select either Global Workflows or Workspace Workflows.
- Create New Workflow: Click
+
to create a new workflow.
Workspace workflows are stored in your project's .a4drules/workflows
folder. The location of global workflows varies based on your operating system.
Dev Agent provides a convenient popover interface that allows you to:
- View Active Workflows: See which global and workspace workflows are currently active.
- Toggle Workflows: Enable or disable specific workflows with a single click.
- Add or Delete Workflows: Quickly create or delete workflows.
The real power comes from how you structure your workflow files. You can:
- Leverage Dev Agent's built-in tools like
ask_followup_question
,read_file
,search_files
, andnew_task
. - Use command-line tools you already have installed like
sf
(Salesforce CLI) orgit
. - Reference external MCP tool calls for integrations.
- Chain multiple actions together in a specific sequence.
Create a file called salesforce-deploy.md
and paste this content:
1. Gather Deployment Information
Ask the user which components to deploy and which org to target:
Validate the target org connection:
2. Pre-Deployment Validation
Check for local changes and potential conflicts:
Run local tests if deploying Apex:
Validate deployment without actually deploying:
3. Analyze and Confirm
Review validation results and ask for confirmation:
4. Execute Deployment
Deploy to the target org:
Monitor deployment status:
5. Post-Deployment Validation
Run tests in the target org:
Verify deployment success and provide summary:
Workflows are completely customizable to your Salesforce development needs. You can create workflows for all kinds of repetitive tasks.
Workflow | Step / Action |
---|---|
Release Management | Grab all merged changes from your feature branches |
Build a changelog from commit messages and Jira tickets | |
Handle version bumps in your sfdx-project.json file | |
Create release packages and validate them across environments | |
New Component Setup | Create the component folder structure |
Generate boilerplate HTML, JS, and CSS files | |
Set up Jest test files with basic test cases | |
Configure component metadata and permissions | |
Deploy to development org for initial testing | |
Integration Testing | Validate Named Credentials and Connected Apps |
Test API endpoints with sample data | |
Check error handling and retry logic | |
Generate integration test reports | |
Update monitoring dashboards | |
Code Quality | Run PMD static analysis on Apex classes |
Check Lightning component accessibility compliance | |
Validate naming conventions across metadata | |
Generate code quality reports | |
Create tickets for issues found |
Basic Org Commands | Command |
---|---|
List authorized orgs | sf org list |
Display org information | sf org display --target-org <org-alias> |
Set default org | sf config set target-org <org-alias> |
Deployment Commands | Command |
---|---|
Deploy source to org | sf project deploy start --target-org <org-alias> |
Deploy with validation only | sf project deploy start --dry-run --target-org <org-alias> |
Check deployment status | sf project deploy report --target-org <org-alias> |
Retrieve metadata from org | sf project retrieve start --target-org <org-alias> |
Testing Commands | Command |
---|---|
Run all Apex tests | sf apex test run --target-org <org-alias> --code-coverage --result-format human |
Run specific test classes | sf apex test run --class-names "AccountTest,ContactTest" --target-org <org-alias> |
Get test results | sf apex test report --target-org <org-alias> |
Data Commands | Command |
---|---|
Query data | sf data query --query "SELECT Id, Name FROM Account LIMIT 10" --target-org <org-alias> |
Import data | sf data import tree --plan data/sample-data-plan.json --target-org <org-alias> |
Export data | sf data export tree --query "SELECT Id, Name FROM Account" --target-org <org-alias> |