Deploy Metadata
sf_deploy_metadataDeploy metadata components to your Salesforce org via Metadata API. Supports validate-only, test execution, and waits for deployment completion.
Instructions
Deploys a set of metadata components directly to the org using the Metadata API SOAP deploy operation. Builds a package.xml and deployment zip in memory. Supports validate-only (checkOnly:true) for pre-deployment validation without making changes. Specify runTests to execute test classes during deployment (required for production). Polls until complete or timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runTests | No | Test classes to run during deployment | |
| checkOnly | No | Validate only, do not actually deploy | |
| testLevel | No | Test level: NoTestRun, RunSpecifiedTests, RunLocalTests, or RunAllTestsInOrg | |
| components | No | Metadata components to include in the deployment package. These reference components already in the org. Can be empty when using componentsXml to deploy new/updated components with inline XML. | |
| waitMinutes | No | Max minutes to wait for deploy to complete | |
| componentsXml | No | Optional inline XML components to deploy. Each entry provides the complete XML definition (type, name, xml). The file path is inferred from type/name. When provided alongside components, both are deployed together. | |
| rollbackOnError | No | Roll back all changes if any component fails |