Home /  Functions / 

Function Templates

Function templates are pre-configured functions that you can use as a starting point for common integration tasks, such as routing errors to an internal alerting system. Templates contain all of the event bindings and environment variables to accomplish each task.

After you create a function from a template, you can customize it to add error handling and other behavior for your use case.

We continually maintain our function template library to ensure each function is up-to-date with new Stedi features and programming best practices.

Create functions from templates

To create functions from a template:

  1. Go to the Functions UI and click the Templates tab to review available function templates.
  2. Click Select for the template you want to use to open its configuration modal.
  3. Click Deploy.
  4. Choose a Name for the function and set existing environment variables (if available).
  5. Click Create function. Stedi deploys the function in your account and configures event bindings if necessary.
Functions generated from templates are available in the New(v2) tab in the Functions UI.

Environment variables

Templates come with pre-configured environment variables relevant to the function's purpose. For example, environment variables may define parameters such as as API keys, authentication tokens, and webhook URLs.

After you create a function from the template, you can edit the function to change these pre-configured environment variables according to your needs.

Event bindings

Function templates also come with pre-configured event bindings that allow the function to run in response to Stedi events, including the events Stedi Core emits as it processes files. This allows you to set up event-driven workflows without manually configuring the event bindings.

After you create a function from the template, you can edit the function to change these pre-configured event bindings according to your needs.

Template Code

After you create a function from a template, you can edit the function's template code according to your needs. We recommend adding error handling before you use the function in production.

If the template contains a single file and is under 4kb, you can edit the function directly in the UI. For more complex updates, like packaging and using external dependencies, you must edit the function locally and then use the Functions API to push the updates to Stedi. Refer to Updating a function for details.

We regularly push updates to function templates. However, Stedi does not automatically update functions created from a template when we publish a new version of that template.

Create functions from templatesEnvironment variablesEvent bindingsTemplate Code

Feedback

Have an idea for something we could improve? Page not clear? We love feedback - send us a message.

Stedi

Build EDI integrations fast, without being an EDI expert

Start building
About
ProductPricingCareersContactBlog
Follow
  1. Twitter
  2. GitHub
Backed by
AdditionBloomberg BetaFirst RoundStripeUSV
Customer AgreementService TermsPrivacy Notice

Stedi is a registered trademark of Stedi, Inc. All names, logos, and brands of third parties listed on our site are trademarks of their respective owners (including “X12”, which is a trademark of X12 Incorporated). Stedi, Inc. and its products and services are not endorsed by, sponsored by, or affiliated with these third parties. Our use of these names, logos, and brands is for identification purposes only, and does not imply any such endorsement, sponsorship, or affiliation.