Overview
You build a Graph query in the query editor inside Graph Explorer. Saving that query creates a Graph Query Template.
A saved query and a Graph Query Template are the same thing. “Graph Query Template” is what the query is called once you save it, which is why the Run Graph Query step in Workflows asks you to pick a template rather than write a query.
Once a query is saved you can reuse it two ways: load it back into Graph Explorer to run it again with different values, or run it automatically from a Workflow.
Create a Query Template
Build a query in the query editor. When it looks right, click Save and give the template a name.
A single saved query is rarely useful on its own: the value you search for changes every time. To make a template reusable, make its values dynamic by wrapping a parameter name in double curly braces, for example {{email}}. At run time, the template uses the parameter value you supply.
Template parameters
- Parameter names are case-sensitive.
- Use only letters, numbers, and underscores. Names cannot contain spaces or special characters.
- You can use as many parameters as you need, one per placeholder.
- A parameter named
account_idis special: when the template runs in a Workflow, it automatically maps totrigger.account.id, with no manual setup needed.
When you load a template in Graph Explorer, you supply values for each parameter before running the query.
Saving a template with the same name as an existing template overwrites the existing one immediately, across all live instances. Graph does not version Query Templates, so make sure the template you save is the one you want to keep.
Manage and load templates
- See every template your organization has saved on the Graph Templates page in the Persona dashboard.
- Load a saved query back into Graph Explorer with the Load button in the query editor. See Graph Explorer interface for the full interface walkthrough.
Use templates in Workflows
Query Templates are what the Run Graph Query step runs. In a Workflow, you select the template and supply a value for each parameter.
A saved template is the building block for automated checks, so the natural next article is Detecting fraud proactively with Graph, which puts a template into a Workflow that runs on every new Account.