Examples

Overview

This guide provides example code snippets that can be used in Flex.io Execute Tasks to create serverless Pipes.

The example script categories include:

If you need any further examples or any other assistance, feel free to get in touch with us and we’ll be happy to help!

Basic Building Blocks

The scripts in this section provide basic building blocks for running code in Flex.io Execute Tasks.

Hello World



Basic Function Hook


Using Pipe Input and Output

The scripts in this section provide examples showing how to use stdin and stdout within the streaming flow of a Pipe

Read input


Write output


Read input and write output


Read input row-by-row and write output


Using File Input and Output

The scripts in this section provide examples showing how to work with files and storage-based Connections with file system access.

List a directory (local storage)


Listing a directory (connection)


Creating a file


Reading from a file


Writing to a file (overwriting contents)


Writing to a file (appending contents)


Transforming Content

The scripts in this section provide examples showing how to take data or content and manipulate it using sample functions.

Basic filter


Basic count


Processing Emails

The scripts in this section provide examples showing how to take email receipt information and manipulate it using sample functions.

Using “From”

Here is an example Python script that uses the from address from the email as a parameter and sending a reply to that address:


Using “Subject” and “Body”

Here is an example Python script that reads the subject and body text from an email:


Using Attachments

Here is an example Python script that reads the attachments from an email: