April 11th, 2025

Guest Blog: Revolutionize Business Automation with AI: A Guide to Microsoft’s Semantic Kernel Process Framework

Revolutionize Business Automation with AI: A Guide to Microsoft’s Semantic Kernel Process Framework

Step-by-Step guide on creating your first process with AI

Microsoft’s AI Framework, Semantic Kernel, is an easy-to-use C#, Java, and Python-based AI framework that helps you quickly build AI solutions or integrate AI capabilities into your existing app. Semantic Kernel provides various ways to integrate the power of LLM into your application. The two core sub-frameworks that Semantic Kernel offers are Agent-based and Process-based. In my previous blogs I have shared steps to create agents with Semantic Kernel’s Agents Framework. In this blog, let me introduce you to the process-based framework.

Semantic Kernel Process Framework

The process-based framework is an event-driven approach for automating business processes using AI. A process is a structured sequence of steps performed to deliver a service or product. Each step in the process adds value to the final result. In this framework, each step generally refers to one Plugin Function or LLM tool. A simple example of a business process is the account opening process.

As mentioned before, the Semantic Kernel process framework provides a way to embed AI into your business processes to improve productivity and decision-making. The process framework follows an event-driven architecture. The core components of the process framework are:

  • Step: A step is the smallest unit in the process.
  • Process: A collection of multiple steps to fulfill a business goal.
  • Pattern: Provides ground rules on how steps are executed for the process to be fully completed.

So, the process begins with defining the steps needed. Each step usually defines one Plugin Function or LLM tool. The tool can either use LLM itself to perform a task or may be simple code logic.

Let’s understand it by taking an example of the Medium blog publishing process. If I want to automate it, the steps can be

Step 1: Let’s define steps
#pragma warning disable SKEXP0080 // Step 3 public class BlogPublisherStep: KernelProcessStep { [KernelFunction] public void PublishBlog(string blogContent) { Console.WriteLine("Entering Blog Publishing Step"); // write here logic to publish to blog // notice, here we don't need Kernel object // as we are not doing any LLM calls Console.WriteLine(blogContent); } } // Step 2 public class BlogGeneratorStep: KernelProcessStep { [KernelFunction] public async Task<string> GenerateBlogContent(string research, Kernel kernel) { Console.WriteLine("Entering Blog Generation Step"); var answer = await kernel.InvokePromptAsync($"Generate insightful blog article for the topic based on research {research}. "); return answer.ToString(); } } // Step 1 public class BlogResearchStep: KernelProcessStep { [KernelFunction] public async Task ResearchBlogTopic(string blogTopic, KernelProcessStepContext context) { Console.WriteLine("Entering Blog Research Step"); // Web Surfer -> surfer internet for the content string research = "Microsoft seeks to empower all its customers to achieve more and Microsoft Azure is no different. With Azure, we hope to enable you to drive limitless innovation. Our self-help support offerings offer you new ways to engage with the Azure support experience and put the power of our Azure resources in your hands. Help API provides you with access to rich and powerful self-help Azure solutions that enable you to troubleshoot Azure issues from your preferred UI without the need to create a Support ticket. By using Help API, you can get access to insight diagnostics, Troubleshooters, and other powerful solutions for your Azure resource and subscription. These solutions are curated by Azure engineers that will expedite your troubleshooting experiences across Billing, Subscription Management and technical issues. This reference documentation serves as a guide for using Help API and specific reference information for each REST operation. Role Prerequisites: To use Help API you must use your AAD token. You must have access to the subscription scope. For diagnostics, you must have reader access role for the resource on which the diagnostics is executed. Solution discovery and execution steps: Discovery solution API is the initial point of entry to discover the solution metadata mapped to the subscription or resource Once the solution/diagnostics is determined based on the description field in the solution discovery response, you can execute the solution using Diagnostics or Solutions API Operation Group Description Operations List all the available Help API REST operations Discovery solution Lists the relevant Azure diagnostics and Solutions using problemClassificationId AND resourceUri or resourceType Diagnostics Create and list diagnostics for an Azure resource. Solutions Create, update and list Azure Solutions for the selected subscription or resource. In this version we will support technical issues , billing/ subscription management issues (non-tenant) Troubleshooters Create and list Troubleshooters as one of the components of Solutions for the specific subscription and resource scope Legal disclosure:This API connects to Azure Services. Your use of this API and the Azure Services it connects to are governed by the agreement under which you obtained Azure Services. SeeMicrosoft Azure Legal Information | Microsoft Azure for more informationfor more information. Support in other languages and interfaces Apart from support in REST API, self help api support is available in the following interfaces and languages: Azure SDK for Java: Artifact | Documentation Azure SDK for .NET: Artifact | Documentation Azure SDK for Python: Artifact | Documentation Azure SDK for JavaScript: Artifact | Documentation Azure SDK for Go: Artifact | Documentation Azure CLI: Code | Documentation PowerShell: Code | Documentation This API connects to Azure Services. Your use of this API and the Azure Services it connects to are governed by the agreement under which you obtained the Azure Services. See Microsoft Azure Legal Information | Microsoft Azure for more information."; await context.EmitEventAsync("ResearchDone", research); } }

Step 2: Now all steps are defined, you can now chain together the steps to form the process using ProcessBuilder.

ProcessBuilder processBuilder = new("BlogGenerationProcess"); // Add the steps var blogGeneratorStep = processBuilder.AddStepFromType<BlogGeneratorStep>(); var blogResearchStep = processBuilder.AddStepFromType<BlogResearchStep>(); var blogPublisherStep = processBuilder.AddStepFromType<BlogPublisherStep>(); // Orchestrate the events processBuilder .OnInputEvent("Start") .SendEventTo(new(blogResearchStep)); blogResearchStep .OnEvent("ResearchDone") .SendEventTo(new(blogGeneratorStep, parameterName: "research")); blogGeneratorStep .OnFunctionResult() .SendEventTo(new(blogPublisherStep));

If you notice, you can add OnFunctionResult to indicate when this function has completed executing and send an event to the next step to start execution. Alternatively, the step itself can emit multiple events, and we can add listeners to all the events, making a decision about which step to execute next based on the event emitted by the previous step.

Step 3: Let’s see it in action

Kernel kernel = Kernel.CreateBuilder() .AddAzureOpenAIChatCompletion("modelName", "https://<resourcename>.openai.azure.com", "<key>") .Build(); var process = processBuilder.Build(); await process.StartAsync(kernel, new KernelProcessEvent { Id = "Start", Data = "Azure Help API" });

Output:

You can find entire example on my GitHub https://github.com/akshaykokane/SemanticKernelProcessFramework/blob/main/ProcessFrameworkIntro.dib

This example shows how Blog Generation Process was automated, and how Semantic Kernel make its extremely easy. But what about deployment?

Deployment

Process framework can be deployed using 2 options:

  1. Local Deployment : For running directly on the local machine or on single server
  2. Cloud Runtimes: For Distributed scalable scenarios, Dapr and Orleans are currently supported

Can I use Agent + Process framework together? The answer is yes!

Reference diagram from the sample application utilizing the Agent + Process framework, as published in the official Semantic Kernel samples Source

You can add combine process framework with Agent framework for more robust solution. Maybe a topic for my next blog.

Process framework is useful tool, and I think the hybrid approach is going to be game changer!

Conclusion

Thanks Akshay for your promotion of the Process Framework and Agent Framework, from the Semantic Kernel team we want to thank you for your work!

0 comments