Skip to content

Is it possible to publish a message (to a client subscription) via a socket within/from a Lambda Step Function? #303

@josoroma-zz

Description

@josoroma-zz

Question:

Is it possible to publish a message (to a client subscription) via a socket within/from a Lambda Step Function?

I was wondering... in the last step of a sequential state machine execution, is it possible to notify back to the user client a custom response via sls api gateway websockets?

I am asking this because the only response I am currently getting back is:

Authenticating with User Pool
Getting temporary credentials
Making API request

{ status: 200,
  statusText: 'OK',
  data:
   { executionArn:
      'arn:aws:states:us-east-1:333:execution:generateCourse:generateCourse111-333-999',
     startDate: '2020-01-21T19:26:47.668Z',
     status: 200 } }

Would be great to hear what should I research in order to implement a kind of custom-data wss response to the user?

Activity

changed the title [-]Is it possible to publish a message (to a client subscription) via a socket within a Lambda Step Function?[/-] [+]Is it possible to publish a message (to a client subscription) via a socket within/from a Lambda Step Function?[/+] on Jan 22, 2020
andyrichardson

andyrichardson commented on Jun 27, 2021

@andyrichardson

Hey, I can answer this!

You can send a message to a socket from any lambda. API Gateway is a completely separate beast, you'll just need to make sure:

  • the lambda has IAM authorization
  • the lambda knows the ID of the connection it wants to message

I don't think this is what you were asking but, if you wanted to invoke the step function with a API Gateway WebSocket event, that currently isn't possible #440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @josoroma-zz@horike37@andyrichardson

        Issue actions

          Is it possible to publish a message (to a client subscription) via a socket within/from a Lambda Step Function? · Issue #303 · serverless-operations/serverless-step-functions