Overview

Teams regularly need to perform a task or a set of tasks in multiple different stories. For example, a threat intelligence story and a phishing response story may use the same procedure to analyse a URL, similarly a user de-provision story and a vulnerability management story may require the creation of a Jira ticket.

Rather than creating the same set of actions in multiple stories (thus violating the DRY-principle), send to story allows users create “sub-stories” to which events can be sent from other stories. When an event is received by a sub-story, the sub-story will perform its action and when finished, emit an event from the calling action.

Sub-stories

Sub-stories work the exact same as normal Tines stories. The only difference being that a sub-story has an Entry action and an Exit action. The entry action must be a webhook type action and the exit action must be a message-only mode event transformation action.

Enabling a story for send to story (creating a sub-story)

From a storyboard, when no actions are selected, in the properties panel there is a checkbox to enable a story for send to story, when this checkbox is clicked, you’ll be asked to specify entry and exit actions. A sub-story can only have one entry and one exit action.

Enable sub-story from storyboard
Enable sub-story from storyboard
Configure send to story
Configure send to story

Entry action

When an event is sent to a sub-story, the entry action will emit an event to its receiver actions. Entry actions must be of type Webhook.

Exit actions

The Exit actions are the last action in a sub-story and must be message-only mode event transformation actions. The content specified in the Exit action will be emitted by the action that originally sent the event to the sub-story.

Access

Controls who is allowed to send to this story. Either select everyone to allow any team send to this story, or select the team that owns the story to restrict access.

Sending to a sub story

When you need to send data to a sub-story, you should use a Send to Story action with the story widget. For example say we have a sub-story called Substory we would send events to this sub-story with the following Send to Story action:

{
  "story": "{{ .STORY.substory %}",
  "payload": {
    "url": "http://evil-site.com"
  }
}

The entry action in Substory will then emit an event similar to the below:

{
  "receive_url_to_analyze": {
    "url": "http://evil-site.com",
    "#event_id": "1029",
    "#action_id": "21"
  }
}

When this event has run down the story, an event will be emitted at the calling Send to Story action that matches the exit action’s configuration.

For example, let’s say the HTTP Request action above was named “Analyse URL” and we have the following exit action defined in Substory:

{
  "mode": "message_only",
  "uppercase_url": "{{.receive_url_to_analyze.url | upcase }}"
}

When the sub-story is complete Analyse URL will emit an event similar to the below:

{
  "analyse_url": {
    "uppercase_url": "HTTP://EVIL-SITE.COM"
  }
}