Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xmatters/xm-labs-step-template

Template for contributing Flow Designer steps to the Flow Steps repo
https://github.com/xmatters/xm-labs-step-template

Last synced: 15 days ago
JSON representation

Template for contributing Flow Designer steps to the Flow Steps repo

Awesome Lists containing this project

README

        

# xM Labs Step Template
Template for contributing Flow Designer steps to the [Flow Steps](https://github.com/xmatters/xMatters-Labs-Flow-Steps) repo

Note: It's recommended to add the step(s) to a blank canvas and then export the workflow so people don't have to create the steps from scratch.

---------





---------

# Files

* [logo.png](/media/hat.png) - Logo for the Hat Factory
* [cool_workflow.zip](cool_workflow.zip) - Exported workflow with the steps dropped onto an empty canvas
* [otherfile.file](/otherfile.file) - Some other file that does something useful.

# Application Name Goes Here
One or two liner about the product here.

Each step for this "application" can be added below. I recommend exporting a workflow with the steps so people can get to using them quickly.

# `APPLICATION_NAME` setup
Add details here about how to generate an auth token or to create a user.

## Get Token
1. Login to `APPLICATION_NAME`.
2. Draw the rest of the Owl.

# Flow Designer Steps

First, import the [cool_workflow.zip](cool_workflow.zip) to have each step imported. If you would like to configure the steps manually or would like more information on what the inputs and outputs do, read on.

## Action Name 1
The "Create App Record" step creates a record in the `APPLICATION_NAME` and such and such.

### Settings
Values for the settings tab. A screen shot is also acceptable. If you have a custom icon, please upload it into the `/media` folder and reference with ` `. See below for the format of a table in markdown.

| Field | Value |
| ----- | ----- |
| Name | Create a Hat |
| Description | Sends a create a hat request to the hat factory. |
| Icon | |
| Include Endpoint | Yes |
| Endpoint Type | Basic Auth |
| Endpoint Label | Hat Factory |

### Inputs
Inputs should be in the form of tables. The syntax looks like this in the markdown. The "content cells" do not have to line up, just make sure you have the right number of columns in each row. Required inputs must be at the top and please for the love of Pete, add some helpful text as to what the input is for or what it does. If the step only allows certain values, make sure to list them!

```
| Name | Required? | Min | Max | Help Text | Default Value | Multiline |
| ----- | ----------| --- | --- | --------- | ------------- | --------- |
| Name | Yes | 0 | 2000 | This is the color of the hat to create | Blue | No |
| Color | No | 0 | 2000 | The major color of the hat. Possible values are Red, White, Blue | Blue | No |
```

| Name | Required? | Min | Max | Help Text | Default Value | Multiline |
| ----- | ----------| --- | --- | --------- | ------------- | --------- |
| Name | Yes | 0 | 2000 | This is the color of the hat to create | Blue | No |
| Color | No | 0 | 2000 | The major color of the hat. Possible values are Red, White, Blue | Blue | No |

### Outputs

| Name |
| ---- |
| Hat |
| Link |

### Script

```javascript
// Retrieve the name and color values
var name = input['Name'];
var color = input['Color'];

// Make the request
var req = http.request({
"endpoint": "Hat Factory",
"path": "/hat",
"method": "POST",
"headers": {
"Content-Type": "application/json"
}
});

var hatPayload = {
"name": name,
"color": color
};

var resp = req.write( hatPayload );

```

## Action Name 2
The "Update App Record" step creates a record in the `APPLICATION_NAME` and such and such.

### Settings

| Field | Value |
| ----- | ----- |
| Name | Update a Hat |
| Description | Sends an update a hat request to the hat factory. |
| Icon | |
| Include Endpoint | Yes |
| Endpoint Type | Basic Auth |
| Endpoint Label | Hat Factory |

### Inputs

| Name | Required? | Min | Max | Help Text | Default Value | Multiline |
| ----- | ----------| --- | --- | --------- | ------------- | --------- |
| Name | Yes | 0 | 2000 | This is the color of the hat to create | Blue | No |
| Color | No | 0 | 2000 | The major color of the hat. Possible values are Red, White, Blue | Blue | No |

### Outputs

| Name |
| ---- |
| Hat |
| Link |

### Script

```javascript
// Retrieve the name and color values
var name = input['Name'];
var color = input['Color'];

// Make the request
var req = http.request({
"endpoint": "Hat Factory",
"path": "/hat",
"method": "POST",
"headers": {
"Content-Type": "application/json"
}
});

var hatPayload = {
"name": name,
"color": color
};

var resp = req.write( hatPayload );

```

# Usage
Details or tips here on how to use the step. Eg. create a new response called "such and such". Or a screen shot of the step(s) hooked into a flow.