1

I am planning to add a few Flows to my Managed Packages. E.g.:

  1. Record Triggered Flow Templates that detects certain conditions
  2. Screen Flows that define UI for Slack notifications sent out from 1.)

Especially the Slack part of Flow depends heavily on hardcoded and org specific information like app, channel, user ids.

That is a problem because:

  1. I need to harcode values for development and testing
  2. I cannot hardcode that into the packaged flow because it will not work in the subscriber org
  3. I don't want my customers to adjust 1001 little fields in my flows after installation
  4. I must assume that my subscriber don't have Slack setup when installing my package

I am now looking for a way to streamline and minimize manual post install steps and also secure my Flow IP a bit.

What are ways to do that? I thought about:

  • Tooling or Metadata API to update the flows
  • Variables in Flow populated via Custom Metadata Types that change from org to org
  • A Post Install Assistant that adjusts the flow from a nice custom UI
3
  • 1
    IIRC you can easily access custom settings via $Setup expressions in flow formulae. Probably similar for CMT?
    – Phil W
    Commented Feb 17, 2023 at 17:24
  • When I have references like that I get errors during package creation: We can't find an action with the name and action type that you specified. I need a mechanism to decouple this. Fake values until a customs getting exists Commented Feb 20, 2023 at 17:30
  • 1
    We have flows that are successfully packaged accessing Custom Settings. For example, a flow formula might include {!$Setup.namespace__Settings_Name__c.namespace__Settings_Field__c} to get a value. No fake values here. First class usage of custom setting fields in flow formulae.
    – Phil W
    Commented Feb 20, 2023 at 17:46

2 Answers 2

2

For the post-install step,

Let's clear the 2 terms first:

Salesforce Flow-in-Slack = the ability to expose screen-based SF Flows in the Slack UI. Instead of the Flow's screens being displayed in native SF Lightning UI at run-time, the screens are displayed as modals in Slack

Slack Workflows = a feature in Slack for creating the logic to interact with messages and external services

Salesforce Flows can be added to AppExchange managed packages and installed in salesforce org. However, Slack workflows cannot be added to managed packages.

After the package is installed, the Slack workplace admin has to create a workflow that exposes the packaged Flow to workplace users. There is no automated way to do it.

I do want to add that I am not familiar enough with Slack API. There may be an option to create/configure workflows. If that is possible then you could add functionality in your package to use that API. You will need to talk to the Slack team about that.

For the other question,

You already have the answer. You can use custom metadata or custom settings; depending on whether you want to supply default values in the package (custom metadata) or want customers to have unique values (custom settings).

You can provide a setup screen to add/update those values. You may also need to account for multiple workplaces as the same app and same org can be used from multiple workplaces.

2
  • When I create a version in 1GP everything works find but 2GP fails with: Your organization doesn't have permission to run the flow in the Slack flow environment. Commented Feb 20, 2023 at 11:16
  • 1
    @RobertSösemann I believe you enable "Slack connect" permission for the user in 1GP and assign it to user? I will have to check how that will work in 2GP
    – Jaswinder
    Commented Feb 21, 2023 at 15:06
2

You should probably use either custom metadata or custom settings for this.

Custom metadata has the advantage that you can deliver values with the package install, but it sounds like you don't necessarily want that since the values will be different for each customer.

Custom settings seem like a good choice for you - and ideally you'd build an admin page with the ability to set the settings there rather than needing to go into SF setup to do so.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .