This is a step-by-step tutorial on how to create a webMethods.io Integration workflow that will automatically upload to your Dropbox account all files received as email attachments via Gmail.
- Gmail account
- Dropbox account
- Login to your webMethods.io Integration tenant or sign up for a free trial if you’re new.
- Create a new project or choose an existing one.
- Go ahead and get started by creating a blank workflow. If you need a refresher on how to get to this point, this guide can be a great introduction.
- Click on the small setting icon on the Start step and choose the Gmail trigger.
Select New attachment as a trigger and complete the authorization – connect webMethods.io Integration with your Gmail account (check the following Tutorial - Using Google services with webMethods.io Integration).
Click Save. You should see the test trigger window.
To test your trigger, you need to perform the trigger action – send an email to your Gmail email address and attach a file:
Go back to the webMethods.io Integration workflow and click Test. You should see the output data from the trigger which webMethods.io Integration will use to configure and test the rest of the workflow. Click Done.
- Search for the Gmail connector and add it to the canvas with the drag and drop feature. This automatically connects with the Gmail trigger.
Click on the small settings icon on the Gmail connector, select Download Attachment as action and complete the authorization – connect webMethods.io Integration with your Google account.
Now you can proceed with the action configuration – use the Incoming data panel and drag and drop the threadId string from the trigger output to the Message ID field:
Click Next, Test and then Done.
- Note that in one email you can receive multiple attachments and we need to upload them one by one. That is why, add the Loop connector to the canvas with the drag and drop feature. This automatically connects with the Gmail connector.
- Click on the small settings icon on the Loop connector – select Each item as Loop Type and drag and drop the Download attachment result array from the Incoming data panel to the Source Array/Object field:
Click Next, Test and then Done.
- Connect the Loop connector to the Stop step. Double click the Loop connector icon to open the Loop canvas. Search for the Dropbox connector and add it to the canvas with the drag and drop feature:
- Click on the small settings icon on the Dropbox connector, select Upload a file as action and complete the authorization – connect webMethods.io Integration with your Dropbox account.
Now you can proceed with the action configuration – in the Source File Path field, drag and drop the file_path string of the current value of the loop. In the Destination Folder Path field, choose the folder in your Dropbox account where all the attachments will be saved.
Click Next and then Done.
- Save your workflow and run it using the play button in the right upper corner and review the result. If you have configured the workflow correctly, the email attachment will be uploaded to your Dropbox folder shortly.
Now every time you receive an email with attachments, they will be automatically uploaded to your Dropbox account. Please note that this may take some time.
- At the bottom-left corner of the screen you can find the Execution history of the workflow:
From here you can monitor the executions status and view error details if needed: