skuid w/ headless flows?

  • 2
  • Idea
  • Updated 3 years ago
  • Under Consideration
Salesforce has a pilot for headless flows. It is the ability to trigger flows from workflow without any need for screens. Essentially programming declaratively.

Has anyone done anything with this? I've on the pilot and just starting to use it this week.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,270 Points 5k badge 2x thumb
I'm working on an integration with this and skuid right now, still in planning phase.

What would be awesome is if one of the action options in the action button was "Call Flow" and could pass variables to the flow.

Since that's not possible, I'm planning to:
  • Use Process Builder to define criteria that will call my flow when a hidden checkbox on the Opportunity is checked ["Create documents"]
  • Create a custom button that sets that checkbox to True (triggering the flow), then opens my pop-up and queries the model that just had rows created by my flow that was triggered.
One issue I'm worried about is the speed of the flow vs. the speed of my Skuid model query, such that my query action may happen before the flow has finished, returning less than the full amount of rows. I'm planning to deal with that by a combination of:
  • running a few delaying actions before my first model query, like opening the popup and blocking the UI for a few seconds
  • adding multiple query model actions in a row
  • adding an action to the model of "new row created in model" results in "query model"
That last one may be the only thing I need to do, I'm just not sure that Skuid will recognize that a new model has been created by a process outside of the skuid interface - can it really listen that well?

We use these flows a lot in non-skuid salesforce, either called by buttons, or now in process builder. But this will be the first skuid integration. 
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
Hey Jack. Did you get this up and running? Curious about latency issues between UI and flow.

I as well would love to see Flows act just like snippets.

I wonder if flow can return a True value once the flow is done similarly to $.Deferred().
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,270 Points 5k badge 2x thumb
I haven't no. Been on the backburner, and I had to reread my post to even remember what was going on...

I just saw this old post about including flows in an iframe:
https://community.skuidify.com/skuid/topics/best_way_to_incorporate_visual_flows

I wonder if you can just call a headless flow the same way, maybe open a pop up that has this flow and then close the popup. 

I know that you can use buttons to open a visualforce page that calls a flow and you never even see anything on the visualforce page, it just goes to the redirect after it's done running the flow. This may be another way of doing it, create a visualforce page with your flow, with a redirect to your skuid page, and open a popup with that visualforce page in an iframe, it should reload when done. 
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,270 Points 5k badge 2x thumb
FYI for anyone following this thread and needing to know how to do it (like me, trying to do this again six months later for a new use case): 

You can call a headless flow in an iframe in a popup with height=0 and width=0, then include in your flow the redirect to page so that it reloads when done. You can also give your flow some size and direct your users "click this button when the area below no longer says loading", then the button closes the popup and does any model query that needs doing, that's how we ended up implementing it.

Would still prefer something that we could do in a snippet, with a deferred promise, has anyone done that and could share how?