{"id":1768,"date":"2026-10-04T13:00:00","date_gmt":"2026-10-04T07:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/"},"modified":"2026-11-15T11:31:16","modified_gmt":"2026-11-15T06:01:16","slug":"apex-invocable-methods-flow","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/","title":{"rendered":"Apex Invocable Methods: Call Apex from Flow the Right Way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Apex Invocable Methods let admins call your Apex code from Flow, as if it were a standard action. You mark one static method with @InvocableMethod, and it appears in Flow Builder under the Action element. This is the cleanest bridge between low-code automation and code, so it shows up in almost every modern org.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, you will build an invocable method with request and response classes, make it bulk-safe, call it from a flow and test it. It builds on <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-trigger-vs-flow-salesforce\/\">Apex trigger vs flow<\/a>, <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-methods-parameters-return-types\/\">Apex methods, parameters and return types<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-bulkification-best-practices\/\">Apex bulkification<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What are Apex Invocable Methods?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An invocable method is a static Apex method annotated with @InvocableMethod. It takes a list of inputs and returns a list of outputs, so one call can serve many flow interviews at once. Apex Invocable Methods also power Agentforce actions and the REST invocable actions resource.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a power socket in a wall. The electrician (developer) builds the wiring once, behind the wall. Then anyone in the house (the admin) can plug in a lamp without knowing how the wiring works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Apex Invocable Methods Matter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Flow is powerful, but some jobs need code. Here is why Apex Invocable Methods matter at Bright Path Tutors.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, a flow needs a complex fee calculation with several rules.<\/li>\n\n<li>Also, the enrolment flow must call LearnHub, which needs a callout.<\/li>\n\n<li>Next, admins want to reuse one tested Apex action in many flows.<\/li>\n\n<li>Agentforce agents use the same invocable methods as actions.<\/li>\n\n<li>Finally, the work stays bulk-safe when hundreds of records trigger the flow.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So invocable methods let admins and developers work together without conflict.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Apex Invocable Methods Work<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apex Invocable Methods run through a clear path. First, you write a static method with @InvocableMethod, a label and a description. Next, you define inputs and outputs, usually as classes with @InvocableVariable fields. Then the admin adds an Action element in Flow Builder and maps flow variables to the inputs. After that, Salesforce groups many flow interviews into one call with a list of requests. Finally, your method returns one result per request, in the same order.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-1-1024x640.png\" alt=\"Apex Invocable Methods diagram showing annotate, variables, add action, bulk call and return\" class=\"wp-image-1766\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">How Flow calls your invocable Apex.<\/figcaption><\/figure>\n\n\n<h3 class=\"wp-block-heading\">The @InvocableMethod Annotation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It takes options such as label, description, category and callout=true. Only one invocable method is allowed per class.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Request and Response Classes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Inner classes with @InvocableVariable fields become the action&#8217;s inputs and outputs. Also, required=true makes an input mandatory in Flow Builder.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Lists In, Lists Out<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The method receives a List of requests and returns a List of results. So the order of results must match the order of requests.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Callouts<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Set callout=true when the method makes HTTP callouts. Then Flow knows how to handle the transaction safely.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Errors<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Throwing an exception sends the flow down its fault path. So write clear messages that admins can show or log.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">@InvocableMethod Options at a Glance<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The table below lists the most used options.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Option<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td>label<\/td><td>Name shown in Flow Builder<\/td><\/tr><tr><td>description<\/td><td>Help text for admins and agents<\/td><\/tr><tr><td>category<\/td><td>Groups the action in the list<\/td><\/tr><tr><td>callout=true<\/td><td>Declares that the method calls out<\/td><\/tr><tr><td>required=true (variable)<\/td><td>Makes an input mandatory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Invocable Apex vs Flow-Only Logic<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The table below compares putting logic in Apex with building it only in Flow.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Feature<\/th><th>Invocable Apex<\/th><th>Flow only<\/th><\/tr><\/thead><tbody><tr><td>Complex calculations<\/td><td>Easy in code<\/td><td>Hard to read<\/td><\/tr><tr><td>Callouts<\/td><td>Full HttpRequest control<\/td><td>HTTP callout action<\/td><\/tr><tr><td>Who maintains it<\/td><td>Developer<\/td><td>Admin<\/td><\/tr><tr><td>Unit tests<\/td><td>Apex tests<\/td><td>Flow tests<\/td><\/tr><tr><td>Best for<\/td><td>Reusable, complex steps<\/td><td>Simple, visible steps<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When to use which depends on complexity. Keep simple steps in Flow. Move complex or reusable steps into Apex Invocable Methods.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-2-1024x640.png\" alt=\"Apex Invocable Methods diagram comparing invocable Apex with Flow-only logic\" class=\"wp-image-1767\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-diagram-2-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Invocable Apex vs Flow-only logic.<\/figcaption><\/figure>\n\n\n<h2 class=\"wp-block-heading\">A Real Apex Invocable Methods Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s build Apex Invocable Methods at Bright Path Tutors. A flow sends a course Id and coupon code, and Apex returns the final fee.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: The Invocable Class<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>public with sharing class CalculateCourseFee {\n    public class Request {\n        @InvocableVariable(label='Course Id' required=true)\n        public Id courseId;\n        @InvocableVariable(label='Coupon Code')\n        public String couponCode;\n    }\n    public class Result {\n        @InvocableVariable(label='Final Fee')\n        public Decimal finalFee;\n    }\n\n    @InvocableMethod(label='Calculate Course Fee'\n        description='Returns the course fee after any valid coupon'\n        category='Bright Path')\n    public static List&lt;Result&gt; calculate(List&lt;Request&gt; requests) {\n        Set&lt;Id&gt; ids = new Set&lt;Id&gt;();\n        for (Request r : requests) { ids.add(r.courseId); }\n        Map&lt;Id, Course__c&gt; courses = new Map&lt;Id, Course__c&gt;(\n            [SELECT Id, Fee__c FROM Course__c WHERE Id IN :ids WITH USER_MODE]);\n\n        List&lt;Result&gt; results = new List&lt;Result&gt;();\n        for (Request r : requests) {\n            Result res = new Result();\n            Decimal fee = courses.get(r.courseId).Fee__c;\n            res.finalFee = (r.couponCode == 'TERM10') ? (fee * 0.9).setScale(2) : fee;\n            results.add(res);\n        }\n        return results;\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The method collects all course Ids first and runs one query for every request. Then it builds one result per request, in the same order.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Use It in Flow<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In Flow Builder, add an Action element and search for Calculate Course Fee.<\/li>\n\n<li>Set Course Id to {!$Record.Course__c} and Coupon Code to {!couponInput}.<\/li>\n\n<li>Store Final Fee in a number variable, such as finalFee.<\/li>\n\n<li>Add a Fault path that shows the error message to the user.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Test It<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>@IsTest\nprivate class CalculateCourseFeeTest {\n    @IsTest\n    static void appliesCouponInBulk() {\n        Course__c c = new Course__c(Name = 'Apex Basics', Fee__c = 5000);\n        insert c;\n        List&lt;CalculateCourseFee.Request&gt; reqs = new List&lt;CalculateCourseFee.Request&gt;();\n        for (Integer i = 0; i &lt; 200; i++) {\n            CalculateCourseFee.Request r = new CalculateCourseFee.Request();\n            r.courseId = c.Id; r.couponCode = 'TERM10';\n            reqs.add(r);\n        }\n        List&lt;CalculateCourseFee.Result&gt; res = CalculateCourseFee.calculate(reqs);\n        Assert.areEqual(200, res.size());\n        Assert.areEqual(4500.00, res[0].finalFee);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The test sends 200 requests, like a bulk flow run, and checks one query is enough. Here is the result.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CalculateCourseFeeTest.appliesCouponInBulk  Pass  (45 ms)\nSOQL queries used: 1 of 100<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Apex Invocable Methods and Agentforce<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Agentforce custom actions use the same annotation. So clear labels and descriptions help both admins in Flow Builder and the agent&#8217;s reasoning engine. We build one in the next post.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with Apex Invocable Methods<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Querying inside the loop over requests.<\/li>\n\n<li>Returning results in a different order from the requests.<\/li>\n\n<li>Adding two invocable methods to one class.<\/li>\n\n<li>Forgetting callout=true when the method calls out.<\/li>\n\n<li>Writing vague labels that admins cannot understand.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for Apex Invocable Methods<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use request and response classes, not bare primitives.<\/li>\n\n<li>Bulkify with one query and one DML for all requests.<\/li>\n\n<li>Write labels and descriptions for admins, not developers.<\/li>\n\n<li>Throw clear exceptions so flows can use fault paths.<\/li>\n\n<li>Test with 200 requests to match bulk flow runs.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Practice Task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add an Is Valid output that tells the flow whether the coupon was accepted. Hint: add a Boolean @InvocableVariable to Result and set it in the loop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Most Asked Interview Questions on Apex Invocable Methods<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Flow and Apex questions appear in almost every developer interview. Here are the 21 questions asked most about Apex Invocable Methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Basic Questions on Apex Invocable Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q1: What is an invocable method?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is a static Apex method marked @InvocableMethod, so Flow can call it as an action.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q2: How many invocable methods can one class have?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Only one, so create separate classes for separate actions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q3: What must the method signature look like?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It must be static, public or global, and take and return lists.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q4: What is @InvocableVariable?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It marks fields in request or response classes as action inputs and outputs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q5: Why does the method take a list?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because Salesforce bundles many flow interviews into one call for bulk safety.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q6: Where does the action appear in Flow Builder?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Under the Action element, grouped by its category.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q7: What does callout=true do?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It declares that the method makes callouts, so the transaction is handled correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code and Scenario Questions on Apex Invocable Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q8: How do you make an input required?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set required=true on its @InvocableVariable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q9: How do you return several values to a flow?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use a response class with several @InvocableVariable fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q10: How do you keep results in the right order?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Loop over requests in order and add one result for each.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q11: How does a flow handle an exception from the method?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It follows the action&#8217;s fault path, so the admin can show or log the message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q12: How do you avoid hitting SOQL limits?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Collect all Ids first and run one query for all requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q13: Can invocable methods do DML?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, but bulkify it, so one DML statement covers all requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q14: How do you test an invocable method?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Call the static method directly with a list of requests and assert the results.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Advanced Questions on Apex Invocable Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q15: How do invocable methods relate to Agentforce?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Agentforce custom Apex actions are invocable methods, so descriptions guide the agent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q16: Can you call an invocable method through REST?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, through the Actions REST resource for custom invocable actions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q17: Why are good descriptions important?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Admins and AI agents choose actions by reading them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q18: How do you handle partial failures?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Return an error field per result instead of throwing, so other requests still succeed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q19: What types can @InvocableVariable fields use?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Primitives, sObjects, lists of those, and Apex-defined types used in flows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q20: When should logic stay in Flow instead?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When it is simple and admins need to see and change it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q21: How do invocable methods run with sharing?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They follow the class sharing keyword, so use with sharing and user mode queries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-dev\/references\/apex-dev\/apex-classes-annotation-invocablemethod.html\" target=\"_blank\" rel=\"noopener noreferrer\">InvocableMethod Annotation (Apex Developer Guide)<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-dev\/references\/apex-dev\/apex-classes-annotation-invocablevariable.html\" target=\"_blank\" rel=\"noopener noreferrer\">InvocableVariable Annotation (Apex Developer Guide)<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Apex Invocable Methods expose Apex as Flow actions.<\/li>\n\n<li>One invocable method per class, taking and returning lists.<\/li>\n\n<li>Use request and response classes with @InvocableVariable.<\/li>\n\n<li>Bulkify with one query for all requests.<\/li>\n\n<li>Clear labels help admins and Agentforce agents.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The same methods can power AI agents. Next, read our guide to <a href=\"https:\/\/swapnilzambare.com\/blog\/agentforce-apex-actions\/\">Agentforce Apex actions<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apex Invocable Methods let admins call your Apex code from Flow, as if it were a standard action. You mark one static method with&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1765,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[239,8,96],"tags":[68,98,11],"swapz_series":[],"class_list":["post-1768","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apex-fundamentals","category-salesforce","category-salesforce-developer","tag-advanced","tag-apex","tag-flows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apex Invocable Methods: Call Apex from Flow<\/title>\n<meta name=\"description\" content=\"Apex Invocable Methods explained simply: @InvocableMethod, @InvocableVariable, bulk inputs, callouts, errors, Flow setup, testing and 21 interview Q&amp;A.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apex Invocable Methods: Call Apex from Flow\" \/>\n<meta property=\"og:description\" content=\"Apex Invocable Methods explained simply: @InvocableMethod, @InvocableVariable, bulk inputs, callouts, errors, Flow setup, testing and 21 interview Q&amp;A.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-04T07:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-15T06:01:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Apex Invocable Methods: Call Apex from Flow the Right Way\",\"datePublished\":\"2026-10-04T07:30:00+00:00\",\"dateModified\":\"2026-11-15T06:01:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/\"},\"wordCount\":1437,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-invocable-methods-flow-featured.png\",\"keywords\":[\"Advanced\",\"Apex\",\"Flows\"],\"articleSection\":[\"Apex Fundamentals\",\"Salesforce\",\"Salesforce Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/\",\"name\":\"Apex Invocable Methods: Call Apex from Flow\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-invocable-methods-flow-featured.png\",\"datePublished\":\"2026-10-04T07:30:00+00:00\",\"dateModified\":\"2026-11-15T06:01:16+00:00\",\"description\":\"Apex Invocable Methods explained simply: @InvocableMethod, @InvocableVariable, bulk inputs, callouts, errors, Flow setup, testing and 21 interview Q&A.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-invocable-methods-flow-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-invocable-methods-flow-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Apex Invocable Methods featured image: title card with an Apex code example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-invocable-methods-flow\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apex Invocable Methods: Call Apex from Flow the Right Way\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apex Invocable Methods: Call Apex from Flow","description":"Apex Invocable Methods explained simply: @InvocableMethod, @InvocableVariable, bulk inputs, callouts, errors, Flow setup, testing and 21 interview Q&A.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/","og_locale":"en_US","og_type":"article","og_title":"Apex Invocable Methods: Call Apex from Flow","og_description":"Apex Invocable Methods explained simply: @InvocableMethod, @InvocableVariable, bulk inputs, callouts, errors, Flow setup, testing and 21 interview Q&A.","og_url":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-10-04T07:30:00+00:00","article_modified_time":"2026-11-15T06:01:16+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Apex Invocable Methods: Call Apex from Flow the Right Way","datePublished":"2026-10-04T07:30:00+00:00","dateModified":"2026-11-15T06:01:16+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/"},"wordCount":1437,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-featured.png","keywords":["Advanced","Apex","Flows"],"articleSection":["Apex Fundamentals","Salesforce","Salesforce Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/","url":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/","name":"Apex Invocable Methods: Call Apex from Flow","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-featured.png","datePublished":"2026-10-04T07:30:00+00:00","dateModified":"2026-11-15T06:01:16+00:00","description":"Apex Invocable Methods explained simply: @InvocableMethod, @InvocableVariable, bulk inputs, callouts, errors, Flow setup, testing and 21 interview Q&A.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-invocable-methods-flow-featured.png","width":2400,"height":1260,"caption":"Apex Invocable Methods featured image: title card with an Apex code example"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apex Invocable Methods: Call Apex from Flow the Right Way"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=1768"}],"version-history":[{"count":1,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1768\/revisions"}],"predecessor-version":[{"id":2341,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1768\/revisions\/2341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/1765"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=1768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=1768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=1768"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=1768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}