StarMeUp OS

Workflow

Public workflow API options

Workflow api provides the capability to orchestrate tasks in order to build a step-by-step process. Each task is called a step.

Create a new workflow

First you should provide some basic details like name and description. Both can be defined by yourself and there is no restriction about those values. Next, you must define the steps of the workflow. Finally and as an optional element, you can provide a trigger to schedule the time which the workflow will run.

Steps refer to some tasks defined for our workflows. In the section steps (below in this document) you can find the options we provide. As an example (take a look to the example section below) we define a filter using some user identifications (user.identification) as parameters, and a notification step. It means you will get the active users inside the company that meet the filter and then the notification step will send to them the template os.custom.notification with the defined deeplink for the mediums the template has defined.

At the end you will find the trigger section. For this specific case the workflow will be scheduled to run at 2022-06-10T13:00:00Z.

Summarizing, we will have 3 sections: Basic information, steps, and trigger.

  • Supported steps: Filter, Notification, AddUserToChannel. (Take a look to the example below). For the Notification step the following template should be used: os.custom.notification

  • Supported trigger options: DATETIME or EMPTY (Take a look to the example below). EMPTY means that no trigger option is provided, so it is going to be scheduled to run right after its creation.

Resource URL

POST: /workflows/public-api/v1/workflows

Request payload

Example:

  {
      "name": "Send star",
      "description": "Send a star to all users",
      "steps": [
          {
              "type": "Filter",
              "params": {
                  "mode": "and",
                  "criterias": [
                    {
                      "field": "user.identification",
                      "operator": "in",
                      "value" : ["identification1", "identification2"]
                    }
                  ]
              }
          },
          {
              "type": "Notification",
              "params": {
                  "notification.deeplink.template": "https://www.starmeup.com/me/sendStar",
                  "notification.template.code": "external.notification",
                  "notification.mediums": {
                      "push": {
                          "enabled": false
                      },
                      "bell": {
                          "enabled": false
                      }
                  }
              }
          }
      ],
      "trigger": {
              "type": "DATETIME",
              "scheduledDateTime": "2022-06-10T13:00:00Z"
      }
  }

Header Parameters

Parameter Optional/Required Description

Authorization

Required

Community Token (You can get information on Authentication).

URL Parameters

N/A

Response

HTTP/1.1 200 OK

Errors

HTTP/1.1 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found

Example:

  {
    "timestamp": "2019-06-26",
    "message": "Internal Server Error",
    "details": "The user wasn’t found",
    "type": "uri=/os-api/public-api/v1/posts",
    "title": "Internal Server Error",
    "detail": "An unexpected or uncontrolled error has occurred in the application."
  }

Steps

Filter

This step provides the ability to select a set of users which fulfill the defined criteria

Example:

  {
      "type": "Filter",
      "params": {
          "mode": "and",
          "criterias": [
            {
              "field": "user.identification",
              "operator": "in",
              "value" : ["identification1", "identification2"]
            }
          ]
      }
  }

Notification

Example:

  {
      "type": "Notification",
      "params": {
          "notification.deeplink.template": "https://www.starmeup.com/me/sendStar",
          "notification.template.code": "external.notification",
          "notification.mediums": {
              "push": {
                  "enabled": false
              },
              "bell": {
                  "enabled": false
              }
          }
      }
  }

AddUserToChannel

Example:

  {
      "type": "Add_User_To_Channel",
      "params": {
        "channelId": "12"
      }
  }

CREATE_CARD

Creates content that is shown in the feed of a specific user.

Example:

  {
      "type": "CREATE_CARD",
      "params": {
        "title": "A title",
        "description": "a description",
        "cta": "https://www.starmeup.com/me/sendStar",
        "ttl": "14.days"
      }
  }

CREATE_LEADER_INSIGHT

Creates content that is shown in the team dashboard of a specific user.

Example:

  {
      "type": "CREATE_LEADER_INSIGHT",
      "params": {
        "title": "A title",
        "description": "a description",
        "cta": "https://www.starmeup.com/me/sendStar",
        "ttl": "14.days"
      }
  }

SWITCHING

Allows to switch the source of the next steps in the workflow.

Example:

  {
      "type": "GET_COLLEAGUES",
      "params": {
          "colleagues.size": 10,
          "colleagues.minAffinity": 0.01,
          "colleagues.criterias": [],
          "colleagues.algorithm": "DEFAULT",
          "colleagues.criteria_mode": "and"
      }
  },
  {
      "type": "SWITCHING",
      "params": {
          "source": "colleagues"
      }
  }


  {
      "type": "FIND_LEADER",
      "params": {}
  },
  {
      "type": "SWITCHING",
      "params": {
          "source": "leader"
      }
  }

+ </div></details>

ADD_BADGE

Add a badge to a user. The badgeId is the id of the badge that you want to add to the user.

Example:

  {
      "type": "ADD_BADGE",
      "params": {
          "badgeId": 79443
      }
  }

Examples

Send Cards to Colleagues

In this example the workflow is looking for the users which meet the criteria of the filter step. In the next step, the workflow is going to get the colleagues of the users found in the previous step. The Switching step changes the input for the next steps to the colleagues found in the previous step. Finally, the workflow creates a card in the feed of the colleagues found in the previous step.

Example:

  {
      "name": "Create a card in feed",
      "description": "Send a card to colleagues of pike3, pike10",
      "steps": [
          {
              "type": "FILTER",
              "params": {
                  "mode": "and",
                  "criterias": [
                      {
                          "field": "user.identification",
                          "operator": "in",
                          "value": ["user1@company.com", "user2@company.com"]
                      }]
              }
          },
          {
              "type": "GET_COLLEAGUES",
              "params": {
                  "colleagues.size": 10,
                  "colleagues.minAffinity": 0.01,
                  "colleagues.criterias": [],
                  "colleagues.algorithm": "DEFAULT",
                  "colleagues.criteria_mode": "and"
              }
          },
          {
              "type": "SWITCHING",
              "params": {
                  "source": "colleagues"
              }
          },
          {
              "type": "CREATE_CARD",
              "params": {
                  "title": "title feed card ttl 14.dias with template1",
                  "description": "description feed card",
                  "cta": "https://app.starmeup.com",
                  "buttonText": "See more",
                  "ttl": "14.days",
                  "template": "template1"
              }
          }
      ]
  }