Robert Ninness
ServiceNow Employee
ServiceNow Employee

Upgrade to Xanadu patch 3 to receive the improved flow generation experience with data pill population and hash tag support (see Product Documentation)

 

There is a known defect with Nov release on hashtags, and here are the workarounds

 

Install and activate Flow generation

 

Refer to the installation instructions on the docs site (docs.servicenow.com) on how to install and configure Flow generation.

 

Once installed and the skill activated in Now Assist Admin console, users will require the now.assist.creator role. Users with this role will now have the Build with Now Assist option when creating a new Flow.

RobertNinness_0-1730984310664.png

 

Using Flow generation

 

Before referencing this guide, it's recommended you review the official ServiceNow documentation (docs.servicenow.com). These docs provide a great overview of the capability and offer a great explanation of an example prompt in addition to other useful details. This guide is aimed to go deeper and provide additional best practices, use cases, and insight into the Flow generation process so that you can best leverage this skill.

 

General guidelines

 

These tips are included in the official docs but are critical to understand to get the most out of Flow generation.
  • Always describe the trigger first. Describe the flow trigger and its data conditions first. After the trigger, describe the actions and flow logic in the same order that you want them to appear in the flow.
  • Refer to actions, flow logic, and tables by name. The closer the names in your prompt are to the actual names, the easier it is for the LLM to recognize them. For example, use the text "for each" or "do the following in parallel" to refer to those specific flow logic options.
    • The exceptions to this are the ELSEIF and ELSE flow logic options. The LLM may better recognize them as "otherwise if" and "otherwise", respectively.
  • Introduce the inputs and outputs first when creating subflows. State the type of each input and output if you can:
    • "Create an input user (record) and output sys id (string)"
  • Avoid spelling errors. Avoid misspelling the names of actions, flow logic, or tables as noisy text hinders quality.
  • Be precise and descriptive in your prompt. Describe the flow trigger, record data, actions, and flow logic in as much detail as you can.
  • Be succinct and direct in your prompt. Get right to your automation idea without an intro sentence or paragraph. Start by specifying whether you want to generate a flow or a subflow. Try using the phrase, "Create a flow that...", then outline the main logic you want your flow to contain.

 

Additional best practices

 

  • Be explicit when writing FOR EACH flow logic. For example:
    • "When the assignee of an incident changes, look up all other incidents assigned to this user. For each incident, log its name"
  • Be explicit when writing PARALLEL flow logic. Write the text in a way that's clear what groups of actions are meant to be executed in parallel. You can use numbers to distinguish the branches:
    • "When a P1 incident is created, do the following in parallel: 1. Log its short description and 2. Look up the user assigned to it and send an email"
  • Keep elements in the same flow logic block in the same sentence. You can use numbered lists as seen in the example. The steps labeled 1-3 are all part of the FOR EACH flow logic block.
    • "Find the newly created problem records from the past day. For every problem that is not assigned, 1) assign it to the level 1 triage group, 2) move the state to "triaged", 3) send a notification to the group."
  • Add clarifying statements with complex flow logic blocksThis helps the LLM generate actions so their placement is correct in the flow.
    • "Find the newly created problem records from the past day. For every problem that is not assigned, assign it to the level 1 triage group and move the state to "triaged." After going through all the problems, send a single notification to the group"
    • "If the approval request is pending, ask the group manager for approval. If the manager approves, close the request. Otherwise (approval request is not pending), log the request state"
  • Use hashtags to increase the chances of populating the table correctly.
  • Use quotation marks for values to be copied verbatim (e.g. a log message). Enclose the data values in quotations marks to help the LLM distinguish between operation names and data values. Both single and double quotes work. Make sure to close your quotes.
    • "Log the message, 'incident reopened'" (The single quotes make it clear that the text "incident reopened" is a data value)
  • Use square brackets or angle brackets to demarcate data pills inside log messages, comments, work notes, etc.
    • "Update the request to pending and add comments, 'Flow will run on [put the request's work start date here] unless this request is cancelled'"
    • "Update the request to pending and add comments, 'Flow will run on <DATE> unless this request is cancelled', where <DATE> is the work start date on the request"
  • If you don't get desired results on your initial try, try adding the word "flow" somewhere in the prompt, such as "Create a flow that begins when..."

 

#Hashtags

 

The new hashtag support in Flow generation allows you to explicitly reference table names, allowing you to get better generative output, especially when working with custom tables. To use this capability, enter text like "#task" in your prompt and select the table of your choice.
RobertNinness_1-1730984310664.png

 

Keep the following in mind to get the most out of this capability.
  • Hashtags are not mandatory. There's a good chance that a reference to a specific table in your prompt will yield the appropriate results. Hashtags can help when you're unable to get the correct table or when working with ambiguous table names.
  • Hashtags work using display names. If you already know the system name, you can use that in your prompt without a hashtag.
  • Today, hashtag only works with table names, in the future we plan to support columns request name, etc.
  • Hashtags help with tables that share the same name. For instance, if you want to reference imp_user instead of sys_user but can't remember the exact system name, you can use #user and select the desired table from the list. Another example is group where you might want to specifically reference sys_user_group or cmdb_group.
  • Hashtags help with tables when their label and value are very different. For example, if the Table Label is Strategic Priority, and the Table Name is sn_gf_strategy, LLM might be struggling to find the correct table if you just use "Strategic Priority" without hashtags
  • Hashtags are limited by the application of the flow. If a user doesn't have read access to a table due to application restrictions, then they will not be able to hashtag that table.

 

Retrieval Augmented Generation (RAG)

 

The RAG capability of Flow generation provides instance awareness, allowing you to reference your custom actions and subflows in prompts. Consider the following to best leverage RAG in your prompts:
  • RAG indexes your custom actions & sub-flows periodically, meaning recently created objects may not show up in generated Flows right away. This indexing process occurs every few hours.
  • The retrieval table/columns/action/subflow is just-in-time and is not used or stored for any other instance or purpose.

 

Unsupported actions

 

Please note that Flow generation does not support all actions available in Flows. Here's a non-exhaustive list of actions that are currently unsupported, though rest assured all of these are on our roadmap.
  • Scripting
  • Transform functions
  • Flow stages
  • Flow name
  • Subflow inputs and outputs
  • Flow variables
  • Service catalog variables: For request flows, we are not populating request variables (or request items)
  • Dynamic condition “to me” examples
  • Retrieval of decision tables
  • Retrieval of Saved trigger

 

Resources

 

Recorded Demos:
 
Overview Workflow Academy Creator Toolbox

 

Share your prompt tips below

If you've found other useful ways to leverage Playbook generation, let us know in the comments!
Comments
Jingfei Chen
ServiceNow Employee
ServiceNow Employee

Please comment below if you have any feedback.

Jagan Pillutla
Tera Contributor

Awesome, Thank you !

ayanshnamde
Tera Contributor

Thanks, really helpful.
For more doc's reference:
Flow generation
Now Assist for Flow Generation - Prashant Kumar LearnIT - Medium

Like this if it is helpful

Version history
Last update:
‎02-19-2025 10:49 AM
Updated by: