All articlesArticle

Stop Editing Your Flows! How to Build "Set it and Forget it" Automations.

Managing Salesforce automation often means getting stuck in the weeds—editing flows every time your marketing or sales team launches a new campaign. If this sounds familiar, you’re not alone. The traditional process—tweaking flows for every new product or campaign, adding hardcoded branches, and inserting record IDs—builds up technical debt, eats away at admin hours, and risks breaking critical business processes.

Let’s explore an alternative you can adopt to truly scale your Salesforce automation: a dynamic mapping system leveraging custom metadata types.


The Problem with Manual Flow Edits

Imagine a scenario where your marketing team rolls out a new campaign, and your flow needs to assign a product based on that campaign. The old approach involves heading into Flow Builder and adding a new decision branch, often hardcoding record IDs for each campaign-product mapping. While this might work for one or two campaigns, it quickly gets unmanageable as you grow:

  • Not scalable: Each addition means more time in Flow Builder, more logic to test, and more complex documentation.
  • Risky: One slip in production could break your entire automation.
  • Hardcoded IDs: These can break your automation when moving solutions between sandboxes and production environments—Salesforce IDs often differ between orgs.
  • High cost: Admins and developers spend unnecessary hours managing incremental changes.

Introducing Dynamic Mapping with Custom Metadata Types

The scalable solution is to decouple mapping logic from your flow by moving it into a table—a custom metadata type in Salesforce. Think of custom metadata types as configurable spreadsheets that flows can reference dynamically.

How it works:

  • Instead of hard-wiring campaign-to-product logic in the flow, you create a custom metadata type as a mapping table.
  • Each time the marketing team launches a new campaign, they add a new row (custom metadata record) associating the campaign with the product.
  • Your Salesforce Flow uses a Get Records element to retrieve the correct product based on the incoming campaign—no logic changes, no risky edits.

This approach means the flow logic itself remains untouched and stable, while the business can grow and adapt as needed—by simply updating metadata records.

Business Benefits

Embracing this dynamic approach delivers three key wins:

  1. Agility: Marketing and admin teams can add new products or campaign mappings in minutes without waiting on a developer.
  2. Cost Savings: Admin and developer hours previously spent on maintenance are reclaimed for more valuable projects.
  3. Reliability: The automation is tested once and remains locked down; no more frequent (and risky) flow updates for simple data changes.

Next Steps

By moving your mapping logic into custom metadata types, you empower your business users, keep production stable, and lay the groundwork for scalable growth. If you want to future-proof your automations and work smarter, not harder, consider adopting this dynamic mapping model in your Salesforce environment.