Update release branch record on completed deployment status
When a deployment finishes, the release branch record in Salesforce is updated to show it reached production, whether it was a hotfix, and when it was last deployed to UAT.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/update-release-branch-record-on-completed-deployment-status/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Engineering · Software delivery
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/update-release-branch-record-on-completed-deployment-status
Set it up with the CLI
- Add it. Copies the folder into
zaps/update-release-branch-record-on-completed-deployment-status/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/update-release-branch-record-on-completed-deployment-status - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy update-release-branch-record-on-completed-deployment-status - Check it. Its recent runs, with status and errors.
npx zap-pack logs update-release-branch-record-on-completed-deployment-status
zaps/update-release-branch-record-on-completed-deployment-status/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 13 to fill in
- connections/salesforce.tsThe
salesforceaccount it uses - triggers/updated-field-on-record.tsWhat starts it:
salesforceupdated_field_on_record - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a Salesforce "Updated Field on Record" trigger (
salesforce,updated_field_on_record) watches the deployment metadata log object for changes to its status field. - The run stops unless the status is
Completed, the process type isDeployment, the run result isSuccess, and no error field is filled in. - Salesforce finds the branch record whose ID matches the branch reference on the metadata log entry. If none matches, the run stops and creates nothing.
- The release-type value is mapped to the hotfix flag (
Hotfixis true, anything else is false). - Salesforce updates that branch record: the production-release checkbox is set to true, the hotfix checkbox gets the mapped flag, and the last UAT deployment datetime gets the deployment date from the log entry.
The Zap never creates branch records. A missing match stops the run.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
REPLACE_METADATA_LOG_OBJECT |
The Salesforce API name of the deployment metadata log object. The trigger watches this object. |
REPLACE_BRANCH_OBJECT |
The Salesforce API name of the branch object whose record gets updated |
REPLACE_STATUS_FIELD |
The metadata log field that holds the deployment status. The trigger watches it, and the Zap runs when it changes |
REPLACE_BRANCH_REFERENCE_FIELD |
The metadata log field that references the branch record |
REPLACE_BRANCH_ID_FIELD |
The branch field the reference is matched against, usually the branch ID |
REPLACE_PROCESS_TYPE_FIELD |
The metadata log field that holds the process type |
REPLACE_RUN_RESULT_FIELD |
The metadata log field that holds the run result |
REPLACE_ERROR_FIELD |
The metadata log field that is filled in when the run errored |
REPLACE_RELEASE_TYPE_FIELD |
The metadata log field that holds the release type, regular or hotfix |
REPLACE_DEPLOYMENT_DATE_FIELD |
The metadata log field that holds the deployment date |
REPLACE_PRODUCTION_RELEASE_FIELD |
The branch checkbox that is set to true when the release reaches production |
REPLACE_HOTFIX_FIELD |
The branch checkbox that records whether the release is a hotfix |
REPLACE_LAST_UAT_DEPLOYMENT_FIELD |
The branch datetime field that holds the last UAT deployment |
Also review these defaults with them: COMPLETED_VALUE (Completed), DEPLOYMENT_PROCESS_TYPE (Deployment) and SUCCESS_RESULT_VALUE (Success) in config.ts must match the org's values. In HOTFIX_LOOKUP in workflow.ts, Hotfix counts as a hotfix; ask whether any other release-type value does too.
Ask which org the Salesforce connection points at. Use a sandbox or integration org for testing.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/update-release-branch-record-on-completed-deployment-status, replace each REPLACE_… value as this file says, then run npx zap-pack deploy update-release-branch-record-on-completed-deployment-status, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
salesforceto the user's Salesforce connection for the org that holds the metadata log and branch objects. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/updated-field-on-record.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. Set the trigger's object toMETADATA_LOG_OBJECTand its watched field toSTATUS_FIELD. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections (and sample the trigger, if it has one) before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run it once as a draft test against the sandbox. Create a branch record and a metadata log entry, both named "[install-test] …". Set the log entry's status to Completed, its process type to Deployment, its run result to Success, and leave its error field empty. Then check that:
- the branch record's production-release box is checked;
- the hotfix box matches the release type;
- the last UAT deployment datetime equals the log entry's deployment date;
- a log entry with a non-matching status, process type or run result, or with an error, changes nothing;
- a log entry whose branch reference matches no record creates no record.
If run-status tools aren't available, check the result in Salesforce directly. Ask the user to delete the test records; the agent doesn't delete them.
Notes
- Each Salesforce step is one action, so a failed update shows up as a failed step in the run history.
- To alert release owners on any stopped or errored run, add an optional alert step that notifies them.
- To write different timestamp fields for production and UAT, add conditional paths that each write their own field.