# Share image attachments from email in Slack using a public link recipe

This use case guides you through connecting Gmail, Workato FileStorage, and Slack to create a powerful automation.

# What does this recipe do?

This recipe extracts image attachments from Gmail, stores them in Workato FileStorage, generates a public link, and posts it in Slack. You can use this recipe to share submitted images, reports, or visuals without manually uploading them.

flowchart TD subgraph Configuration[" "] direction TB subgraph Gmail[&nbsp Gmail New email trigger &nbsp] t1(Trigger) --- setup1(setup) end subgraph DownloadAttachment[&nbsp Gmail Download attachment action &nbsp] Action1(Action) --- setup2(setup) end subgraph CreateFile[&nbsp Workato FileStorage Create file action &nbsp] Action2(Action) --- setup3(setup) end subgraph GenerateLink[&nbsp Workato FileStorage Generate action &nbsp] Action3(Action) --- setup4(setup) end subgraph Slack[&nbsp Workbot for Slack Post message action &nbsp] Action4(Action) --- setup5(setup) end end CreateRecipe([Create recipe]) -- Configure your recipe --> Configuration --> Workflow([Automated workflow]) Gmail --> DownloadAttachment --> CreateFile --> GenerateLink --> Slack classDef default fill:#fff,stroke:#67eadd,stroke-width:2px; classDef WorkatoTeal fill:#67eadd,stroke:#b3e0e1,stroke-width:2px,color:#000; classDef SubgraphDash fill:#e1fffc,stroke:#f66,stroke-width:2px,color:#000,stroke-dasharray: 5 5 class Gmail,DownloadAttachment,CreateFile,GenerateLink,Slack SubgraphDash class t1,setup1,setup2,setup3,setup4,setup5,Action1,Action2,Action3,Action4,CreateRecipe,Workflow WorkatoTeal

# Create your recipe

Complete the following steps to create your recipe:

USE CASES ARE INTENDED AS EXAMPLES ONLY

This use case serves as an example. Modifications to triggers, actions, or conditional logic may be necessary to adapt this recipe to your workflow.

1

Sign in to Workato.

2

Select the project where you plan to create the recipe.

3

Create connections for Gmail and Slack:

WORKATO UTILITY CONNECTORS DON'T REQUIRE SETUP

The Workato FileStorage connector doesn't require connection setup.

Create a Gmail connection.
1

Click Create > Connection.

2

Search for and select Gmail on the New connection page.

3

Enter a name for your connection in the Connection name field.

4

Use the Location drop-down menu to select the project where you plan to store the connection.

5

Select OAuth 2.0 as the Authentication type.

6

Optional. Click Advanced settings and select additional OAuth 2.0 scopes. If left blank, the following scopes are requested:

  • See your primary Google Account email address
  • See and edit your email labels
  • Send email on your behalf
  • View your email messages and settings
  • Read, compose, and send emails from your Gmail account
7

Click Sign in with Google and sign in to your Google account to complete the setup.

Create a Slack connection.
1

Click Create > Connection.

2

Search for and select Slack on the New connection page.

3

Enter a name for your connection in the Connection name field.

Slack connection setupSlack connection setup

4

Use the Location drop-down menu to select the project where you plan to store the connection.

5

Optional. Configure Advanced and Custom OAuth profile settings if required for your account type.

6

Click Connect.

4

Go back to your project and click Create > Recipe.

Create a new recipeCreate a new recipe

5

Enter a name for your recipe in the Name field.

6

Select the project where you plan to store the recipe from the Location drop-down menu.

7

Click Start building.

Start building your recipeStart building your recipe

8

Click Pick a starting point, then select Trigger from an app.

9

Click Select an app and trigger event.

10
Set up your Gmail New email trigger.
1

Search for Gmail and select it as your app. The New email trigger is selected automatically.

Choose GmailChoose Gmail

2

Optional. Configure the Trigger poll interval field to specify how frequently to check for new events.

3

Optional. Configure the When first started, this recipe should pick up events from field to specify the date to retrieve emails from.

Step summary

This trigger checks Gmail for new emails at an interval you specify.

11

Click + Add step and select IF condition.

12
Set up your IF condition.
1

Switch Data field to formula mode and map the Gmail Attachments Step 1 datapill.

2

Set Condition to is present.

Check if the email contains attachmentsCheck if the email contains attachments

Step summary

This IF condition checks if the email contains attachments.

13

In the Yes path, click + Add step and select Repeat for each.

14
Set up your Repeat for each loop.
1

Map the Gmail Attachments Step 1 list datapill to the Input list field.

2

Ensure Repeat mode is set to One item at a time.

Iterate through attachments listIterate through attachments list

Step summary

This loop iterates through all the attachments in the email, ensuring that they're all processed.

15

Click + Add step and select IF condition.

16
Set up your second IF condition.
1

Map the Gmail Mime type Step 1 datapill to Data field.

2

Set Condition to contains.

3

Enter image/ in the Value field.

Check the image's MIME typeCheck the image's MIME type

Step summary

This IF condition filters only image attachments.

17

Click Select an app and action.

18
Set up your Gmail Download attachment action.
1

Search for Gmail and select it as your app.

Choose GmailChoose Gmail

2

Select the Download attachment action.

Select the Download attachment actionSelect the Download attachment action

3

Map the Gmail ID Step 1 datapill to the Email ID field.

4

Map the Gmail Attachment ID Step 1 datapill to the Attachment ID field.

Configure the Download attachment actionConfigure the Download attachment action

Step summary

This step downloads the image attachment's content.

19

Click + Add step and select Action in app.

20
Set up your Workato FileStorage Create file action.
1

Search for Workato FileStorage and select it as your app.

Choose Workato FileStorageChoose Workato FileStorage

2

Select the Create file action.

Select the Create file actionSelect the Create file action

3

Map the Foreach Filename Step 3 datapill to the File name field.

4

Specify the location of where to create the file in the File path field.

5

Map the Gmail Content bytes Step 5 datapill to the File contents field.

Select the Create file actionSelect the Create file action

Step summary

This step stores the downloaded image in Workato FileStorage.

21

Click + Add step and select Action in app.

22
Set up your Workato FileStorage Generate shareable file link action.
1

Search for Workato FileStorage and select it as your app.

Choose Workato FileStorageChoose Workato FileStorage

2

Select the Generate shareable file link action.

Select the Generate shareable file link actionSelect the Generate shareable file link action

3

Set the Scope field to Download.

4

Map the Workato FileStorage File path Step 6 datapill to the File path field.

Configure the Generate shareable file link actionConfigure the Generate shareable file link action

Step summary

This step generates a public download link for the image.

23

Click + Add step and select Action in app.

24
Set up your Slack Post message action.
1

Search for Slack and select it as your app.

Choose SlackChoose Slack

2

Select the Post message action.

Select the Post message actionSelect the Post message action

3

Use the Channel drop-down menu to specify where to post the message.

4

Enter a message in the Basic text field. For example, *New attachment*.

5

Map the Workato FileStorage File name Step 6 datapill to the Attachment title field.

6

Map the Workato FileStorage Shareable link Step 7 datapill to the Attachment title link field.

7

Optional. Enter text in the Attachment text field. This text appears under the attachment link.

Configure the Post message actionConfigure the Post message action

Step summary

This step posts the image link in Slack, which users can click to download the attachment.

OutcomeOutcome

25

Click Save.

Your Share image attachments from email in Slack using a public link recipe is ready to test and implement.

Example recipe configuration.

Share image attachments from email in Slack using a public link recipeShare image attachments from email in Slack using a public link recipe


Last updated: 6/23/2025, 5:34:25 PM