{"id":25544,"date":"2025-01-15T13:00:00","date_gmt":"2025-01-15T13:00:00","guid":{"rendered":"https:\/\/pl.server2.purelogics.net\/?p=25544"},"modified":"2025-01-17T09:37:11","modified_gmt":"2025-01-17T09:37:11","slug":"automate-workflow-data-cloud-flows-invocable-actions","status":"publish","type":"post","link":"https:\/\/pl.server2.purelogics.net\/?p=25544","title":{"rendered":"Automate Your Workflow with Data Cloud-Triggered Flows and Invocable Actions"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Essential_Steps_to_Create_an_Automated_Workflow_within_Data_Cloud\" title=\"Essential Steps to Create an Automated Workflow within Data Cloud&nbsp;\">Essential Steps to Create an Automated Workflow within Data Cloud&nbsp;<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Step_1_Set_Data_Required\" title=\"Step 1: Set Data Required&nbsp;\">Step 1: Set Data Required&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Step_2_Bring_and_Map_Data\" title=\"Step 2: Bring and Map Data&nbsp;\">Step 2: Bring and Map Data&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Step_3_Build_an_Invocable_Action\" title=\"Step 3: Build an Invocable Action&nbsp;\">Step 3: Build an Invocable Action&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Step_4_Build_a_Platform_Event\" title=\"Step 4: Build a Platform Event&nbsp;\">Step 4: Build a Platform Event&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Step_5_Generate_a_Platform_Event-Triggered_Flow\" title=\"Step 5: Generate a Platform Event-Triggered Flow&nbsp;\">Step 5: Generate a Platform Event-Triggered Flow&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Step_6_Build_a_Data_Cloud-Triggered_Flow\" title=\"Step 6: Build a Data Cloud-Triggered Flow&nbsp;\">Step 6: Build a Data Cloud-Triggered Flow&nbsp;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\/#Concluding_Thoughts\" title=\"Concluding Thoughts&nbsp;\">Concluding Thoughts&nbsp;<\/a><\/li><\/ul><\/nav><\/div>\n<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">5<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p class=\"wp-block-paragraph\">Salesforce Data Cloud is a robust platform that helps organizations unify customer data from multiple sources, building an actionable and comprehensive view of each customer. Triggered flows let businesses automate actions created on real-time data updates within Salesforce Data Cloud. This data integration lets you react to changes within data as they occur, guaranteeing business processes and workflows are synced with the most updated information.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Invocable actions within Salesforce Flow are sustainable actions that can be triggered in a flow. Developers create pre-built or custom invocable actions with Apex, permitting more specific or complex functionality. These actions can simplify flow design and minimize the need for complicated logic. Additionally, invocable actions allow external integration of services and systems by offering actions that perform integration tasks and make API calls.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This blog will discuss utilizing Data Cloud-triggered flows using invocable action to increase efficiency through Data Cloud automation.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Essential_Steps_to_Create_an_Automated_Workflow_within_Data_Cloud\"><\/span>Essential Steps to Create an Automated Workflow within Data Cloud&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s assume a situation where a customer applies for a credit card online. In Data Cloud, application data will include a data model object (DMO), initiating a Data Cloud-triggered flow. There will be an action to review the customer&#8217;s credit score and send that data back to Sales Cloud.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"600\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-1.jpg\" alt=\"data cloud\" class=\"wp-image-25546\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-1.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-1-300x237.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Set_Data_Required\"><\/span>Step 1: Set Data Required&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s essential to decide the data of fields required to support your current use case before you indulge data within Data Cloud through the Ingestion API. The given object must uphold all the fields linked to a credit card.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you define fields required to support your use case, before utilizing the ingestion API, you should follow the Ingestion API Schema File criteria to create a file to get data into Data Cloud seamlessly. Look at the following sample YAML to assist the object defined before:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"800\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-7.jpg\" alt=\"data cloud\" class=\"wp-image-25552\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-7.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-7-285x300.jpg 285w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This code will get the sample application for the above-mentioned use case. The YAML and object design are linked to the POST approach in this sample application.&nbsp;&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Bring_and_Map_Data\"><\/span>Step 2: Bring and Map Data&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, establish a data stream that brings credit card information into the Data Cloud. Then, chart the data lake object coming through the stream into a data model object.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"450\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-2-2.jpg\" alt=\"data cloud\" class=\"wp-image-25547\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-2-2.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-2-2-300x178.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Build_an_Invocable_Action\"><\/span>Step 3: Build an Invocable Action&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After that, build an Apex class for all data actions, go to Setup &gt; Developer Console, and press File &gt; New &gt; Apex Class. Type in a name for the Apex class, e.g., \u201cCreditCheck.\u201d We have built an endpoint in the personalized code below that generates an HTTP request to a credit company that returns the required score.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"700\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-6.jpg\" alt=\"data cloud\" class=\"wp-image-25551\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-6.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-6-300x276.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Build_a_Platform_Event\"><\/span>Step 4: Build a Platform Event&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, build a platform event to assist the call for a credit check. This type of event is initiated every time someone requests a credit check. It has two specific fields: one that records the SNN, and the second captures a Lead ID; these are then used to update the current Lead record. In the event-triggered flow platform, both fields will be referenced.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"600\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-3.jpg\" alt=\"data cloud\" class=\"wp-image-25548\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-3.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-3-300x237.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Generate_a_Platform_Event-Triggered_Flow\"><\/span>Step 5: Generate a Platform Event-Triggered Flow&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In this step, generate a platform event-triggered flow that is initiated every time an event is created to get a credit check. Platform event-triggered flow will utilize the Apex class to obtain the credit score and update all Lead records with the required credit score retrieved from the Apex class.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need to do the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure the triggered flow whenever a credit card application platform event is obtained.&nbsp;<\/li>\n\n\n\n<li>Build a variable, e.g., vCreditScore, to save the credit score sent back through the Apex class.&nbsp;<\/li>\n\n\n\n<li>Attach the action built within Step 2 through the Apex class.&nbsp;<\/li>\n\n\n\n<li>Choose the SSN in the action being presented as the parameter.&nbsp;<\/li>\n\n\n\n<li>Define the result from the Apex action.<\/li>\n\n\n\n<li>Update all Lead records via the Lead ID that initiated the flow, and then update the credit score using the value received from the invocable action.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s a complete flow looks like:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"600\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-4.jpg\" alt=\"data cloud\" class=\"wp-image-25549\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-4.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-4-300x237.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Build_a_Data_Cloud-Triggered_Flow\"><\/span>Step 6: Build a Data Cloud-Triggered Flow&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Make a Data Cloud-triggered flow provoked when a row is included in the Credit Card Application DMO. Data Cloud-triggered flow will identify if consent is accessible. If case consent exists, a Lead record will be built, and a request will be made to get the credit score through the LeadID as a parameter. If, by any chance, consent isn\u2019t there, then the flow will automatically exit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need to do the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure the flow when a record is included in the credit_card_application DMO.<\/li>\n\n\n\n<li>Build a variable, e.g., vLeadid, to save the ID from the Lead record that\u2019s recently created.<\/li>\n\n\n\n<li>Make a decision split to identify whether a credit check request has been received. This decision is taken from a field from the credit_card_application DMO.<\/li>\n\n\n\n<li>There can be two outcomes: if the decision is true, utilize an action to form a Lead record and conserve the Lead ID of the record recently created to the variable vLeadID.&nbsp;<\/li>\n\n\n\n<li>After creating the Credit Card Application event, give it to the SSN linked to the record within the DMO and the newly recorded Lead ID.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s what a completed event looks like:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"700\" src=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-5.jpg\" alt=\"data cloud\" class=\"wp-image-25550\" srcset=\"https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-5.jpg 760w, https:\/\/pl.server2.purelogics.net\/wp-content\/uploads\/2025\/01\/INSIDE-5-300x276.jpg 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next, activate these flows. As information is stored in the Data Cloud, the flow is activated, invoking credit appeals performed via an invocable action, enabling HTTP requests to a credit agency. Here, we discussed how to utilize the invocable action within a single flow, but it\u2019s also possible to trigger and reuse it with numerous Data Cloud-triggered flows.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Concluding_Thoughts\"><\/span>Concluding Thoughts&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Data Cloud invocable actions and triggered flows provide robust tools to streamline and automate processes in the Salesforce Data Cloud. With the ability to trigger custom code by using invocable actions and real-time data integration, businesses can use a system created to handle high-frequency updates and huge volumes of data. Using an event-triggered architecture, it responds to data updates instead of depending on a schedule, making Data Cloud more responsive and efficient.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PureLogics has 20+ years of experience+ in offering <a href=\"https:\/\/pl.server2.purelogics.net\/services\/shopify-development-services\/\">Salesforce development services<\/a>. Our certified developers can help you build customized Salesforce solutions for your unique business needs. We offer solutions for everything from Salesforce implementation to data migration and seamless integrations. <a href=\"https:\/\/pl.server2.purelogics.net\/contact-us\/\">Partner with PureLogics<\/a> for a flawless Salesforce experience!\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">5<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> Salesforce Data Cloud is a robust platform that helps organizations unify customer data from multiple sources, building an actionable and comprehensive view of each customer. Triggered flows let businesses automate actions created on real-time data updates within Salesforce Data Cloud. This data integration lets you react to changes within data as they occur, guaranteeing business <a href=\"https:\/\/pl.server2.purelogics.net\/?p=25544\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":11,"featured_media":25545,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[564],"tags":[],"class_list":["post-25544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-salesforce"],"_links":{"self":[{"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/posts\/25544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25544"}],"version-history":[{"count":3,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/posts\/25544\/revisions"}],"predecessor-version":[{"id":25576,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/posts\/25544\/revisions\/25576"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=\/wp\/v2\/media\/25545"}],"wp:attachment":[{"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pl.server2.purelogics.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}