Skip to content

ANALYZE WORKFLOW Prompt

Prompt Engineering: Analyzing Workflows with LLMs

Section titled “Prompt Engineering: Analyzing Workflows with LLMs”

Large Language Models (LLMs) can be powerful tools for analyzing workflows, processes, or sequences of tasks. By crafting effective prompts, you can leverage an LLM’s ability to process information and identify patterns to gain insights, identify potential bottlenecks, and receive recommendations for workflow optimization.

Understanding How to Prompt for Workflow Analysis

Section titled “Understanding How to Prompt for Workflow Analysis”

To get an LLM to analyze a workflow, you need to provide it with a description of the workflow and clearly state your goal for the analysis. There isn’t a specific ‘directive’; rather, you use natural language to explain the process and what you want the LLM to do with that information.

Here’s a conceptual example:

User: Our current customer support workflow is as follows: 1. Customer submits a ticket via email. 2. A tier-1 agent picks up the ticket and attempts to resolve it using our knowledge base. 3. If unresolved, the ticket is escalated to a tier-2 agent. 4. The tier-2 agent investigates further, potentially involving engineering. 5. Resolution is communicated to the customer. Can you analyze this workflow and provide recommendations for improvement, focusing on speed and customer satisfaction?
LLM: Certainly! Based on your customer support workflow, here's an analysis and some recommendations for improvement:
**Analysis of Current Workflow:**
* **Linear Process:** The flow is straightforward and easy to understand.
* **Potential Bottlenecks:** Tier-1 resolution success heavily depends on the knowledge base quality. Escalation to Tier-2 can introduce delays, especially if Tier-2 or engineering are backlogged.
* **Information Silos:** Communication between Tier-2 and engineering might not be streamlined.
**Recommendations for Improvement:**
1. **Enhance Knowledge Base:** Invest in a more comprehensive and easily searchable knowledge base for Tier-1 agents. Consider AI-powered suggestions within the ticketing system.
2. **Implement Triage System:** For incoming tickets, use an automated system (or a dedicated role) to categorize and prioritize tickets, potentially routing complex issues directly to Tier-2 if identifiable early.
3. **Improve Tier-1 Capabilities:** Provide more training and tools to Tier-1 agents to resolve a higher percentage of issues without escalation.
4. **Streamline Escalation:** Define clear SLAs for Tier-2 response. Implement a collaborative platform for Tier-2 and engineering to work on complex tickets simultaneously.
5. **Introduce Self-Service Options:** Develop a customer-facing FAQ and troubleshooting portal to reduce the number of incoming tickets for common issues.
6. **Collect Feedback:** After resolution, send a short survey to customers to measure satisfaction and identify areas for ongoing improvement in the support process itself.
7. **Monitor Key Metrics:** Track metrics like First Contact Resolution (FCR), Average Handle Time (AHT), and Customer Satisfaction (CSAT) to measure the impact of changes.

In this example, the user describes their workflow and asks for an analysis with specific improvement goals. The LLM provides insights and actionable suggestions.

Best Practices for Prompting Workflow Analysis

Section titled “Best Practices for Prompting Workflow Analysis”

To get the most out of LLM-assisted workflow analysis, consider these best practices:

  • Provide Sufficient Context: Clearly describe the workflow. Include the steps involved, roles of individuals or teams, tools used, and any known pain points or challenges. The more detail, the better the analysis.
  • Specify Goals for Analysis: Clearly state what you want to achieve. Are you looking for efficiency gains, cost reduction, improved quality, bottleneck identification, or automation opportunities?
  • Focus on Key Areas: If you have specific concerns, guide the LLM to focus on those areas. For example, “Analyze our content creation workflow, paying special attention to the review and approval stages.”
  • Ask for Actionable Insights: Encourage the LLM to provide practical and actionable recommendations. Request specific suggestions, best practices, or potential tools that could be implemented.
  • Consider Different Perspectives: You can ask the LLM to analyze the workflow from different viewpoints, such as ‘from a customer’s perspective’ or ‘from an employee’s perspective’.
  • Request Pros and Cons: For suggested changes, you can ask the LLM to outline potential advantages and disadvantages.
  • Iterate: Start with a general analysis, then ask follow-up questions to dive deeper into specific recommendations or areas of concern.

Example Application: Python Implementation with OpenAI API

Section titled “Example Application: Python Implementation with OpenAI API”

Let’s look at a Python script that prompts an LLM to analyze a workflow.

from openai import OpenAI
import os
# client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
client = OpenAI(api_key='YOUR_OPENAI_API_KEY') # Replace with your key
def analyze_workflow_with_llm(workflow_description, analysis_focus):
try:
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{
"role": "system",
"content": "You are an expert workflow analyst. Your goal is to identify inefficiencies and suggest improvements."
},
{
"role": "user",
"content": f"Please analyze the following workflow: {workflow_description}. Focus on: {analysis_focus}. Provide potential bottlenecks and actionable recommendations."
}
],
max_tokens=500, # Adjust for complexity of workflow
temperature=0.5, # Lower temperature for more factual, less creative analysis
n=1,
stop=None
)
return response.choices[0].message.content.strip()
except Exception as e:
return f"An error occurred: {e}"
# Example usage:
customer_support_workflow = ("1. Customer submits a ticket via our online portal. "
"2. The ticket is automatically assigned to a Tier 1 support agent based on category. "
"3. Tier 1 agent attempts to resolve using a standard knowledge base within 4 hours. "
"4. If unresolved, Tier 1 escalates to Tier 2, providing notes. "
"5. Tier 2 agent (more experienced) investigates, aiming for resolution within 24 hours. "
"6. If Tier 2 needs engineering input, they create a linked bug/task for the dev team. "
"7. Dev team provides input or a fix. "
"8. Tier 2 communicates resolution back to the customer and closes the ticket.")
focus_areas = "identifying bottlenecks, improving resolution time, and enhancing customer satisfaction"
analysis_result = analyze_workflow_with_llm(customer_support_workflow, focus_areas)
print("Workflow Analysis Result:\n")
print(analysis_result)

In this script, analyze_workflow_with_llm sends a detailed description of a customer support workflow and specific areas of focus to the LLM. The system message primes the LLM to act as a workflow analyst.

Running the script will produce an analysis from the LLM. The output will vary but should address the described workflow and focus areas, similar to this:

Workflow Analysis Result:
Okay, let's break down this customer support workflow with a focus on identifying bottlenecks, improving resolution time, and enhancing customer satisfaction.
**Workflow Description:**
1. Customer submits ticket (online portal).
2. Auto-assignment to Tier 1 (category-based).
3. Tier 1 attempts resolution (knowledge base, 4-hour SLA).
4. Escalation to Tier 2 (with notes).
5. Tier 2 investigates (resolution aim 24 hours).
6. Tier 2 links bug/task for dev team if needed.
7. Dev team provides input/fix.
8. Tier 2 communicates resolution to customer & closes.
**Potential Bottlenecks:**
1. **Tier 1 Knowledge Base Dependency (Step 3):** If the knowledge base is incomplete, outdated, or difficult to search, Tier 1 agents will struggle, leading to unnecessary escalations and delays.
2. **Tier 1 to Tier 2 Handoff (Step 4):** The quality of notes from Tier 1 to Tier 2 is crucial. Incomplete information can mean Tier 2 has to re-gather information, wasting time.
3. **Tier 2 Agent Availability/Workload (Step 5):** If Tier 2 agents are overloaded, escalated tickets will queue, significantly impacting the 24-hour resolution aim.
4. **Engineering Dependency (Steps 6-7):** This is a major potential bottleneck. Engineering teams often have different priorities and SLAs. Delays here directly impact customer resolution time. Lack of clear communication channels or priority alignment can exacerbate this.
5. **Information Siloing:** Information might get lost or misinterpreted between Tier 1, Tier 2, and Engineering if not managed well.
**Actionable Recommendations:**
* **Improve Tier 1 Effectiveness:**
* **Invest Heavily in Knowledge Base:** Regularly update, expand, and improve the searchability of the Tier 1 KB. Consider AI-powered KB suggestions.
* **Tier 1 Training:** Provide ongoing training to Tier 1 on new product features, common issues, and advanced troubleshooting techniques to increase their First Contact Resolution (FCR) rate.
* **Standardized Escalation Templates:** Ensure Tier 1 agents use a structured template when escalating to Tier 2, including all necessary diagnostic information.
* **Streamline Tier 2 Operations:**
* **Skills-Based Routing for Tier 2:** If possible, route escalated tickets to Tier 2 agents with specific expertise relevant to the issue.
* **Empower Tier 2:** Give Tier 2 agents more tools and permissions to resolve issues without always needing engineering for common complex problems.
* **Optimize Engineering Collaboration:**
* **Clear SLAs with Engineering:** Establish agreed-upon response and resolution times with the development team for support-escalated issues.
* **Dedicated Support Liaison in Engineering:** Consider having a point person or a rotation within engineering to prioritize and handle support escalations.
* **Integrated Ticketing/Bug Tracking:** Ensure seamless integration between the support ticketing system and the engineering bug/task tracking system for better visibility and communication.
* **Enhance Customer Satisfaction & Proactive Measures:**
* **Proactive Communication:** If a delay is expected (e.g., waiting for engineering), proactively inform the customer rather than letting them wait in silence.
* **Customer Self-Service Portal:** Develop a comprehensive FAQ, troubleshooting guides, and community forum to empower customers to resolve common issues themselves, reducing ticket volume.
* **Feedback Collection:** Implement post-resolution surveys to gather customer feedback on the support experience and identify areas for improvement.
* **Root Cause Analysis:** For recurring or severe issues, conduct root cause analysis to implement permanent fixes, reducing future tickets.
* **Monitoring and Metrics:**
* Track Key Performance Indicators (KPIs) like FCR, Average Handle Time (AHT) for each tier, escalation rates, resolution time, and Customer Satisfaction (CSAT) scores to measure the impact of any changes made.
By addressing these bottlenecks and implementing these recommendations, you should see improvements in resolution times, a reduction in escalations, and ultimately, higher customer satisfaction.

This chapter explored how to use LLMs for workflow analysis. By providing detailed context, clearly stating your analysis goals, and prompting for actionable insights, you can leverage an LLM’s capabilities to gain valuable perspectives and concrete recommendations for optimizing your processes. This technique can be applied across various domains to improve efficiency and effectiveness.