cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Creating Files in Python in Workato

annawojcik
Deputy Chef I
Deputy Chef I

I would like to create a mechanism that, upon initialization of a recipe in Workato from the 4me system, generates a PDF file based on the data provided in the payload. I would like to use the 4me connector and a script written in Python for this purpose. Does the triggered recipe have its own user space where such a file can be created? If so, after how long is it cleared?

1 ACCEPTED SOLUTION

gary1
Executive Chef III
Executive Chef III

This sounds totally doable. To be clear, are you saying the Python script will generate the PDF? The native connector may not support the library you need to do that, so keep that in mind.

I'm not sure what you mean by "user space". When a recipe is triggered, it will perform all actions according to its design. The results of those actions will be stored in a log for a configurable amount of time, but it's for reference. For example, a user wouldn't go to a log to download the generated PDF. 

If the Python script generates a PDF, you'll need to return the PDF data/file contents within the recipe and then do something with the data in a subsequent action, like email it or upload it or whatever.

The recipe might look something like this:

  1. Trigger is received from 4me, providing all input data
  2. Pass 4me data into Python or another connector to generate a PDF
  3. Pass PDF data into email action to email it to someone as an attachment
  4. Pass PDF data into AWS S3 connector to upload it to S3
  5. Pass PDF data (into anything else to do anything else!)

Hope this helps!

View solution in original post

1 REPLY 1

gary1
Executive Chef III
Executive Chef III

This sounds totally doable. To be clear, are you saying the Python script will generate the PDF? The native connector may not support the library you need to do that, so keep that in mind.

I'm not sure what you mean by "user space". When a recipe is triggered, it will perform all actions according to its design. The results of those actions will be stored in a log for a configurable amount of time, but it's for reference. For example, a user wouldn't go to a log to download the generated PDF. 

If the Python script generates a PDF, you'll need to return the PDF data/file contents within the recipe and then do something with the data in a subsequent action, like email it or upload it or whatever.

The recipe might look something like this:

  1. Trigger is received from 4me, providing all input data
  2. Pass 4me data into Python or another connector to generate a PDF
  3. Pass PDF data into email action to email it to someone as an attachment
  4. Pass PDF data into AWS S3 connector to upload it to S3
  5. Pass PDF data (into anything else to do anything else!)

Hope this helps!