Writing Einstein Copilot actions that call flows.

Writing Einstein Copilot actions that call flows.

I've been having a play with Einstein Copilot and writing actions that call flows to add functionality that doesn't exist, as well as getting an idea of various issues that aren't super clearly documented.

The process I'm going to go through is adding a lead via Copilot. Out of the box this just doesn't work. Einstein copilots come with a set of existing actions, anything different you want to do you'll need to build an action for.


Can't create a lead without having an action added.

For this demo, I wanted to prove that I could call a flow, pass inputs, and get an output.

Here's my flow:

Pretty basic, doesn't need to be more complicated for now. You can see that I'm using variables to fill in the various fields, these are flagged as input. It's also really important to have an output variable. If you don't have this, you get a weird error that doesn't explain what's wrong, but this will go away if you have that output. In this example, I'm just passing the ID of the lead back.

Ok, so that's our flow done. Now we need to add an action. Inside the copilots actions editor, I chose the flow option, selected my flow (autolaunched only) and this is how I set my action up.


Inside the Copilot Action instructions, I told it to expect a name, a company name and email, and to take care of splitting out the name into first and last name. From there, because I chose the flow when setting up the action, the input and output variables are exposed for use.

Once this is all mapped, I need to add it to the copilot. The other part I got stuck on here is that "add to copilot" was greyed out; you'll need to deactivate the copilot before you can add the action.

Now when I run the action, it looks like this:


I'm still working out how to craft the output instructions so that it gives me a link to the lead instead of just the ID, but that's not a major.

My initial thoughts are these:

  • There's probably a market/need for general processes that aren't included out of the box to be added, whether through the AppExchange or just sharing approaches as above. It'll be interesting to see how the community responds to this, lots of opportunities for blog posts I imagine.
  • There are lots of weird little bugs; error messages that make no sense, boxes that when you tick you can't untick? It's a beta, so it's not a biggie.
  • Prompt builder is a whole other beast that I haven't touched on. I'll be writing up a post on the AI ecosystem inside Salesforce, I think bringing all the various parts into a single view will be useful for understanding the model at this early stage of the products lifecycle.

I'm really keen to keep working on this tool, and getting more value from it. I'm especially keen to do more on the 'Grounding' aspect, and understanding how to pass in record collections via flows so I can use it for analytics.

If you want to try this out for yourself, this trailhead gives you a demo org with Einstein installed.

https://trailhead.salesforce.com/content/learn/projects/quick-start-einstein-copilot/connect-your-flows-to-einstein-copilot

Joshila Murugan

Salesforce Certified Application Architect | Salesforce Developer 6X Certified

7 个月

Hi David, where you able to get to showing a link in einstein copliot?

赞
回复

要查看或添加评论,请登录

David Smith的更多文章

  • Streamscript - Integration from within Salesforce Flows

    Streamscript - Integration from within Salesforce Flows

    Setting the scene I have a Vend shop. Someone purchases one of my products, and that order data, along with…

    9 条评论
  • Salesforce integration licenses - how to implement

    Salesforce integration licenses - how to implement

    Note: This process has changed since I wrote this, and the article is no longer correct. Leaving here for archival…

    41 条评论

社区洞察

其他会员也浏览了