Send to Story

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 analyze 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.

❗️Important

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. 

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 'All teams & drafts' to allow any team to send to this story, or select the team that owns the story to restrict access. Users can only grant access to teams for which they have the "story create" permission.

You can view all sub stories available to your team by clicking the "Shared with this team" section in the stories page. You will not be able to view or modify the contents of the story unless you have the relevant permissions in the team owning said story.

Need to share with other teams? Reach out to the team to discuss adding the feature to your Tines tenant.

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 key in formulas. 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_name>>",
  "payload": {
    "url": "http://example.com"
  }
}

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

{
  "receive_url_to_analyze": {
    "url": "http://example.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 "analyze URL" and we have the following Exit action defined in Substory:

{
  "mode": "message_only",
  "uppercase_url": "<<UPCASE(receive_url_to_analyze.url)>>"
}

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

{
  "analyze_url": {
    "uppercase_url": "HTTP://EXAMPLE.COM"
  }
}

Retrieving event data from Story runs using Send to Story 

This feature is now documented under APIs.

Was this helpful?