Hyperflow Best Practices
Learn the best practices for creating and maintaining your Hyperflows
Hyperflow Implementation
Use structured and standardized approaches
Implement Hyperflows using standardized patterns when possible to maintain consistency across your organization. This helps with maintainability and knowledge sharing. For example,
Create Hyperflows for a specific use case that works across multiple external systems (eg. ordering device during IT onboarding that requires completing tasks across ServiceNow and the Procurement Systems) or for a specific integration that addresses multiple use cases (eg. ticket management in ServiceNow)
When writing Hyperflow prompts, in additional to instructions for what Hyperflow should do, provide instructions for what it should not do and how it should handle exceptional scenarios.
Implement proper error handling
Design your Hyperflows with robust error handling mechanisms.
Consider how the workflow should respond to various failure scenarios, similar to how transient failures are handled in distributed environments with automatic retry mechanisms.
Plan for scenarios where API or Action executions fail.
Test thoroughly before deployment.
Break into Manageable Steps
For complex processes, break your Hyperflows into smaller, manageable steps that can be independently tested and verified. This approach resembles the WorkChain process class in other workflow systems, where units of work are specified as steps with logical outlines.
Plan for Data Handling and Privacy
Carefully consider what data your Hyperflow will handle and ensure proper privacy measures are in place. Follow guidelines from the Generative AI and Open Data best practices to maintain transparency and appropriate data handling.
When does the Hyperflow execution end, or how can the user end it?
The end of execution of a Hyperflow is determined by the underlying LLM / AI model - when the AI model decides that a user’s request has been fulfilled, or is unable to be fulfilled (for example, a request that is out of scope), it will end execution. After that, you will see the Feedback buttons on the Conversation interface.
Additionally, phrases like “That’s all my ask” or “Thank you!” can also end execution.
When a Hyperflow is finished, to trigger it again, your application needs to detect another Intent that triggers this Hyperflow.
Design for User Interaction
How do Hyperflows interact with the user?
Channels integrated with the application that execute the Hyperflows. This is consistent across all types of flows and fulfillments.
Email, SMS, etc., using the Notification Action that, for better security, needs to be explicitly added to the Hyperflow by the flow builder.
Are Hyperflows output formatted?
By default, Hyperflows produce markdown-formatted output. The formatting can be changed in one of two ways:
Prompt instructions
For highly bespoke and complex requirements, you can create display functions with user interaction nodes in workflows. Examples include:
Customized data display cards
Charts
Prevent overloading a Hyperflow with any task (eg. formatting instructions) that can be easily achieved with a workflow.
Balance Automation with Human Oversight
While Hyperflows can operate autonomously, determine appropriate points for human oversight and intervention, especially for critical decisions or complex scenarios. These can be provided using Hyperflows instructions and User Interaction Nodes in Workflow used as Functions.
Maintenance
Regularly Review and Update Your Hyperflows
Set a schedule to review your Hyperflows regularly, ensuring they remain aligned with business objectives and leverage the latest platform capabilities.
Leverage Version Control
Keep track of changes to your Hyperflows using version control practices. Document each version with comprehensive context about changes made.
Gather and Incorporate User Feedback
Since Hyperflow leverages feedback learning to improve its capabilities, establish mechanisms to collect and analyze user feedback about their interactions with your Hyperflows.
Optimization
Reduce unnecessary steps
Optimize your Hyperflows by eliminating redundant steps and streamlining execution paths.
Reduce perception of latency
LLMs are inherently slow to respond. This is compounded with RAG that requires search / retrieval, followed by LLM summarization.
Hyperflows and the RAG Action function support streaming of output without having to wait for the complete response to be generated. Leverage these to reduce the perception of latency.
Optimize memory and context management
During a conversation session, Hyperflows always have context of the conversation history. Additionally, Hyperflows provide three levels of memory for you to use:
Context window: a per-request short-term memory which is limited by the context window of the underlying AI model. Currently, Hyperflows provide 100K+ token context window, which will continue to expand rapidly in the upcoming releases,
Session Variables: a per-session shared memory which can be used by all the flows that are triggered during a user session. Functions and Nodes are provided to easily read/write to this memory from Hyperflows and Workflows, respectively.
Custom tables: long-term memory that can be used across sessions. Functions and Nodes are provided to easily read/write to this memory from Hyperflows and Workflows, respectively.
Using appropriate memory is critical to ensuring accuracy and performance. For example,
Avoid returning too much content from a function call to the Hyperflow context window. Instead, use pagination (API calls), or post-process data using a Workflow before returning only the necessary information to the Hyperflow.
Instead of passing information between Hyperflows and functions, use session variable as shared memory.
Last updated