Skip to content

Automation

Other systems steps

Connect workflows to other systems. Call web APIs, exchange files over FTP and SFTP, send and read EDI messages, use AI, and geocode addresses.

These steps talk to something outside SAPUGO: a web API, a file server, a trading partner's EDI messages, or an AI model.

Calls to other systems take time and can fail. Keep them outside a transaction, and plan what happens when a call fails: wrap it in Try / Catch / Finally to record the error, retry, or carry on.

Keep credentials safe#

Store API keys and passwords as secrets under Settings, Developer Tools, Secrets, with New secret. On a step's text input, use the lock icon to pick a secret instead of typing the value. Once saved, a secret's value can't be read again. To change it, use Rotate.

Web APIs#

HTTP Request makes one call.

  • The method: GET, POST, PUT, PATCH, or DELETE.
  • The address, headers, and body.
  • The authentication: none, basic (username and password), or bearer token.
  • A timeout, and how to read the response, for example as JSON.

When a workflow makes several calls to the same system, create a New HTTP Client once with the base address, authentication, and defaults. Then use HTTP GET, HTTP POST, HTTP PUT, HTTP PATCH, and HTTP DELETE with it.

Use JSON Parse and Break Struct to pick values out of a response, and Make Struct or JSON Stringify to build a request body.

Note: An HTTP step is for when your workflow calls another system. A webhook works the other way around: SAPUGO tells another system about every change to a table, without a workflow.

File servers#

New FTP / SFTP Client connects to a file server over FTP, FTPS, or SFTP, with a host, port, and credentials. Then use:

StepWhat it does
List FTP DirectoryLists the files and folders at a path.
Download FTP FileDownloads a file so other steps can read it.
Upload FTP FileUploads a file, such as a generated CSV.
Delete FTP FileDeletes a file.
Rename / Move FTP EntryRenames or moves a file or folder.
Create FTP Directory, Remove FTP DirectoryCreate or remove a folder.
Stat FTP EntryChecks whether a path exists and reads its details.

A common pattern: on a schedule, list a supplier's folder, download each new file, read it with the CSV steps, write the records, then move the file into a "done" folder.

EDI messages#

SAPUGO reads and writes three EDIFACT message types used between trading partners:

MessageMeaningSteps
ORDERSPurchase orderParse EDIFACT ORDERS, Generate EDIFACT ORDERS
DESADVDespatch adviceParse EDIFACT DESADV, Generate EDIFACT DESADV
PRICATPrice catalogueParse EDIFACT PRICAT, Generate EDIFACT PRICAT

A parse step reads a message and returns its header and lines, on a Valid or Invalid path. A generate step builds a message file from a header and lines. Always decide what happens to a message that doesn't parse, for example notifying a group and keeping the file for review.

Use these only when your partner actually exchanges EDIFACT messages. If they send a CSV file on a server, use the file server and CSV steps instead.

AI#

StepsWhat they do
New AI Client, AI Complete, AI EmbedUse SAPUGO's built-in AI. New AI Client sets the model tier and instructions, AI Complete returns text for a prompt, and AI Embed returns a vector for search and matching. These use your organization's AI credits.
Compatible AI Client, Compatible Complete, Compatible EmbedThe same, using an AI service you provide that offers an OpenAI-compatible API, with your own key. These don't use AI credits.

Use AI for judgment or drafting that a rule can't express, such as classifying a free-text request or drafting a reply. Decide what happens with the result and when the call fails. Don't use AI for calculations, totals, or status changes. Use value steps and business rules for those.

Addresses to locations#

Geocode Address turns a street address into a point you can store in a Location column or use with the location values, such as distance and nearest.

Plan your integrations#

For each integration, name the other system, what is sent, what is kept from the response, and what happens when the call fails. Keep every key and password in Secrets, never in the workflow itself.

Stuck, or found something missing? Ask the community.

Ask the community

View as MarkdownSuggest an improvement