• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Recipe Building Recipe Building Questions
S

Saul Macht

started a topic about 5 years ago
Answered

How can I use Workato to post notifications to a topic on AWS Simple Notification Service (SNS)?

I am currently trying to integrate Workato with some of my other Apps on AWS using AWS Simple Notification Service (SNS). I see that within Workato, you have an AWS Lambda connector which can be used to invoke AWS Lambda functions. Would it be possible for me to use this connector to invoke a AWS Lambda function that creates an SNS notification?


Best Answer
B
Bryan Yap said about 5 years ago

Hi Saul, this is indeed possible to achieve. In fact, I have a recipe at https://www.workato.com/recipes/626721-aws-lambda-sns-topic which does just this. 


Please follow the steps below to implement the Lambda function in AWS and the recipe in Workato.

  • Create your AWS Lambda function

image

 AWS Lambda function code (Python):

from __future__ import print_function

import json
import urllib
import boto3

print('Loading message function...')


def send_to_sns(message, context):
    print("New message from Workato: " + str(message['body']))
    sns = boto3.client('sns')
    sns.publish(
        TopicArn=message['topic'],
        Subject=message['subject'],
        Message=message['body']
    )

    return ('Sent to SNS Topic: ' + str(message['body']))

  • Create your Workato Recipe with the AWS Lambda action. You will need to configure your function input/response which should correspond to the data format of the input/response of your Lambda function.

    AWS Lambda function input format:

    image


    image



    Workato AWS Lambda Invoke function action:

    image

Answer

Bryan Yap

said about 5 years ago

Hi Saul, this is indeed possible to achieve. In fact, I have a recipe at https://www.workato.com/recipes/626721-aws-lambda-sns-topic which does just this. 


Please follow the steps below to implement the Lambda function in AWS and the recipe in Workato.

  • Create your AWS Lambda function

image

 AWS Lambda function code (Python):

from __future__ import print_function

import json
import urllib
import boto3

print('Loading message function...')


def send_to_sns(message, context):
    print("New message from Workato: " + str(message['body']))
    sns = boto3.client('sns')
    sns.publish(
        TopicArn=message['topic'],
        Subject=message['subject'],
        Message=message['body']
    )

    return ('Sent to SNS Topic: ' + str(message['body']))

  • Create your Workato Recipe with the AWS Lambda action. You will need to configure your function input/response which should correspond to the data format of the input/response of your Lambda function.

    AWS Lambda function input format:

    image


    image



    Workato AWS Lambda Invoke function action:

    image

Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count