Components

Overview

A component is a portion of reusable code that accomplishes a specific task, or connects with an outside service. For example, the SFTP component allows integrations to download and modify files on an SFTP server. The Slack component posts messages to Slack channels.

Several components are strung together to form an integration. A very simple integration might use the AWS S3 component to pull down a file from S3, and post the contents of the file to a Slack channel using the Slack component.

Complex integrations might be comprised of dozens of actions.

Prismatic-Provided Components

Prismatic offers a wide array of components to accomplish a variety of things, like serializing data formats, invoking REST endpoints, or interacting with commonly-used SaaS platforms like AWS, Slack, or Dropbox - see our component catalog for a full list of components. Source code for some Prismatic-provided components is available on GitHub.

You can read about components within the web app by clicking the Components link on the left-hand sidebar. For more detail about a particular component, click the Component > link of the component you want to know more about.

Custom Components

The majority of your integration can likely be developed using Prismatic-provided components. For the portions of your integrations that are specific to your industry or product, Prismatic provides the ability to run custom code as part of your integration. You can deploy your own code in the form of reusable custom components or short code component steps.

For More Information: When Should I Use a Custom Component vs a Code Component?

Component Actions

Components contain one or more actions that can be invoked. For example, the AWS S3 component contains actions to copy S3 objects, delete objects, get an object's contents, etc.

You can view the actions of a component by clicking Components on the left-hand sidebar of the web app, and then clicking into a component. You will see the actions a component contains, required credentials to execute those actions, and inputs the actions take.

For More Information: Custom Component Actions

Component Authorization Methods

Some components require credentials to interact with a SaaS provider, REST endpoint, etc. Those credentials might be username/password sets, API keys, OAuth2 tokens, etc.

To see what authorization methods a component can use, click the Components link on the left-hand sidebar and select a component. Authorization methods will be listed in the component description page.

For More Information: Authorization Credentials, Credentials in an Integration

Component Action Inputs

Component actions take inputs, and execute on those inputs accordingly. Inputs might include a RESTful URL endpoint, an S3 bucket name, a Slack webhook to invoke, or even a binary file like an image or PDF to upload or process.

Inputs can take one of three forms:

  • A value is a simple string (perhaps a URL for an HTTP request).

  • A reference is a reference to the output of a previous step or trigger. For example, if a previous step pulls down a file from AWS S3 and the step is named Fetch my file, then you can reference Fetch my file as in input for another step, and that subsequent step will be passed the file that Fetch my file returned.

    Outputs from one step can be referenced by a subsequent step by referencing the previous step's results field. So, if a previous step returned an object - for example, if an HTTP - GET action pulled down some JSON reading { "firstkey": "firstvalue", "secondkey": "secondvalue" } - you access that secondvalue property in a subsequent step's input by referencing that HTTP - GET step and choosing results.secondkey in your Reference search.

  • A config variable references a customer's config variable that has been assigned to an instance. For example, if each customer has a config variable named CMS_API_URL, you can enter CMS_API_URL to pass in that config variable as input. Config variables can be distinct for each customer.

To enter values for the input of a step, first select if you want the input to be a value, reference, or config variable. Then, enter a value for the value, name of a previous step and search for the reference, or name of a config variable for the config variable.

For More Information: Custom Component Inputs, Integration Designer

Component Action Outputs

Component action outputs take one of three forms:

  • A primitive value, like a string, boolean value, number, or list of primitives. A subsequent step that references this output will receive the string, boolean, number, or list as input.

  • An object. An output might include multiple key-value pairs:

    { "key1": "value1", "key2": ["value2.0", "value2.1", "value2.2"] }

    You might see this after pulling JSON from an HTTP endpoint. Specific values from an object can be referenced as inputs using familiar JavaScript .dot and ["bracket"] notation. Using the above as an example, if you wanted to access value2.1 you could reference results.key2[1].

  • A binary file. Binary file outputs contain a combination of a file Buffer and in indicator of content type (like "image/png") in the form:

    {
    "data": Buffer,
    "contentType": String
    }

Outputs from steps can be used as inputs of subsequent steps by referencing results of a previous step.

For More Information: Custom Component Outputs,