Creating a graph

A graph is a series of nodes, connected by links, that execute their steps in a predictable fashion. Each node in the graph is an adaptor, which is a either piece of business logic or another graph. A graph will always have a start node and must finish with a return node; otherwise, the graph will not be valid.

Acquia Journey describes the executable pieces as graphs because they are Directed Acyclic Graphs, which are executed by Acquia Journey's proprietary graph engine. Each graph contains nodes, including temporary placeholder nodes called ghost nodes, connected by links. A graph may have a listener attached or receive parameters when called from another graph.

The following example graph has three nodes: a Columnar Table and two Return Nodes.

Journey Graph

The graph also has two links: a Goto link and an Error link. The first node in the graph has an attachment on its left-hand side; this attachment can be moved to any node in the graph to make it the first node.

To learn more about working with graphs in Acquia Journey, refer to the following sections:

Parameters and listeners

A graph may optionally receive parameters or listen with an adaptor, but not both.

Listening adaptors

Graphs can have special starting nodes, called listening adaptors, which denote where and how data will be picked up to be put into the graph. Listeners are always displayed in the top left-hand part of the graph window. The following listener types are supported:

  • Database - Process a queue of items from a database table
  • Queue - Process messages arriving in a message queue
  • Twitter - Process Twitter stream items, such as hashtags, keywords, or direct messages
  • Graph API - Allow other systems to interact with your graph


When called from another graph, a graph may receive parameters, which allow you to reuse business logic with different input values. When the graph is executed, the schema location for each parameter is populated by the graph that called it. Because the value is copied to the schema location, modifications of the value from the called graph will not modify the value known to the calling graph.

The graph is traversed by executing each node in order and following the appropriate link, based on the result, to the next node. The links between nodes denote how the data flows, and are traversed in the following order of priority:

  • Error - Executed if the node does not execute correctly
  • Conditional - Executed if a conditional expression returns True
  • Goto - Executed if none of the error or confitional conditions are met

Ghost nodes

Ghost node iconNodes with no information, known as ghost nodes, are displayed with grey boxes in your graph. For your graph to validate, all ghost nodes must be replaced with nodes containing valid information.

Graph validation

A graph will execute only if all of the following conditions are true:

  • No ghost nodes
  • No ghost links
  • All nodes have their inputs and outputs mapped to data sources
  • At least one return node exists

With all of the previous conditions satisfied, the Graph Editor window will display the Valid Graph indicator.

Valid graph

Graphs with validation warnings will display a validation warning icon.

Validation warning icon

Validation warnings

Warning Note
Graph does not have a return node Every graph must have at least one return node.
Graph contains ghost nodes Before a graph can be executed all ghost nodes (displayed in grey) need to be replaced with executable node types. The number in parentheses indicates how many ghost nodes there are.
Graph contains ghost links Before a graph can be executed all links must be one of Conditional, Error or Goto. Click the highlighted links to set the type of the link. The number in parentheses indicates how many ghost links there are.

Creating a graph

To create a blank graph in an existing project, perform the following actions:

  1. Sign in to Acquia Journey.
  2. On the Home Screen, identify the project you want to customize.
  3. Find the project's tile, and then click its Project Editor icon Project Editor icon.
  4. In the top left of the page, click the action menu icon Action menu.
  5. Click Create New.
  6. In the Graphs box, click Blank to select a blank graph.
  7. In the Name text field, enter a name for your graph.
  8. At the bottom of the page, click Create New Item.

Adding a new node to your graph

To add a new node to the graph you are currently editing, use one of the following methods:

  • From an existing node:
    1. Point to an existing node (except a return node) to display a grab arrow.
    2. Drag and drop the grab arrow to an empty area of the window to create a new ghost node with a goto link to the previous node.

      Add another node

  • Right-click anywhere in the graph, and then click Add Node to Graph to create a new node.

Deleting a node from a graph

To delete a node from the graph you are editing, right click the node, and then click Delete Node. Acquia Journey will also remove any links associated with the node. Links can be moved separately by selecting the connection point of the link, and then moving the link to a new node.

Moving nodes in a graph

Nodes will generally snap to a grid if moved individually. Many nodes can be moved at once by creating a rubber-band selection around the nodes, and then selecting the grey background to move all of the nodes simultaneously:

Move a group of nodes

Replacing ghost nodes

To replace a ghost node with a valid node, perform the following actions:

  1. Use one of the following methods to select the node:
    • Double-click the ghost node.
    • Right-click the node, and then click Replace Node.

    Acquia Journey will display a Replace Node dialog box.

  2. Select a replacement node.

For more information about the different node types, read about Nodes in Acquia Journey.

Managing a listener adaptor

You can add or remove a listener adaptor from your graph.

Adding a listener adaptor

To add a listener adaptor to your graph, complete the following steps:

  1. At the top of the graph, click Add Listener.
  2. In the Listener Type list, click the type of listener that you want to add.
  3. Complete the configuration for your chosen listener adaptor type.
  4. Click Save.

Removing a listener adaptor

To remove a listener adaptor from your graph, complete the following steps:

  1. At the top of the page, click the Remove icon.
    Acquia Journey will display a Remove Listener dialog box.
  2. Click Yes, Remove Listener.

Managing parameters

You can add, modify, and delete individual parameters from your graph or remove all parameters.

Adding parameters

To add parameters, when editing a graph complete the following steps:

  1. Click Add Parameters at the top of the graph window to display the Parameters dialog box.
  2. For each parameter that you want to add, click Add Parameter, and then enter a name for your new parameter.
  3. Click the arrow icon Left arrow to the right of your parameter, and then select the schema location to obtain the parameter from when the graph is called.
  4. When you are finished, click the close icon Close dialog box icon for the dialog box.

Modifying or deleting a parameter

To modify or delete a parameter, when editing a graph complete the following steps:

  1. Click Edit at the top of the page.
  2. Make any necessary changes:
    • To delete a parameter, click the trashcan icon Trashcan icon to the left of the parameter name.
    • To modify a parameter's schema location, click the arrow icon Left arrow to the right of the parameter name, and then choose a new schema location.
  3. When you are finished, click the close icon Close dialog box icon for the dialog box.

Removing all parameters

To remove all parameters from your graph, complete the following steps:

  1. Click Remove at the top of the page.
    Acquia Journey will display a Delete Item dialog box.
  2. Click Yes, Delete Item to remove all parameters from your graph.

To edit a link between nodes, click the arrow between the nodes. The Edit Link panel will appear on the right side of the page. In the Edit Link panel, you can set the type of link (Error, Conditional, or Goto), and if your link needs more explanation, provide an alternative Description.

Using a Conditional link, you must specify an expression under the Link Operation section of the Edit Link panel. The condition expression is any valid JavaScript expression. The value of the preceding node is automatically populated into the variable VAL. Common expressions include:

  • String equality - VAL === "My String Value"
  • Numeric equality - VAL == 6

For additional examples, see the reference section of Conditions and expressions.

Contact supportStill need assistance? Contact Acquia Support