Pinpoint Journey - Send through Lambda

0

Hi,

When creating a journey and sending messages through a Lambda ("Send through a custom channel -> Execute a Lambda function"), I can't seem to find a way to customise the payload that the Lambda is supplied on a per-event basis.

As an example, I would like to:

  1. Start a journey with a segment
  2. Execute a Lambda and tell it to send Content A to customers in the segment
  3. Wait for a period of time
  4. Execute the same Lambda and tell it to send Content B to customers in the segment

I would like to create a single Lambda but ask it to send different content at different points in a single journey.

Is there any way to do this?

Thanks,
Geoff.

asked 4 years ago797 views
2 Answers
0

Hi!

I'm having exactly the same issue - what i found out so far is the fact that according to the documentation, you can actually set MessageConfig.Data to contain arbitrary payload. Example:

aws pinpoint list-journeys --application-id <YOUR_APPLICATION_ID>

{
    "JourneysResponse": {
        "Item": [
            {
                "Activities": {
                    "8OoZiq9qB9": {
                        "CUSTOM": {
                            "DeliveryUri": "arn:aws:lambda:eu-central-1:<YOUR_ACCOUNT_ID>:function:pinpoint-dev-somelambda",
                            "EndpointTypes": [
                                "CUSTOM"
                            ]
                        },
                        "Description": "Hello"
                    },
                    "O56tkxsxLV": {
                        "Holdout": {
                            "NextActivity": "8OoZiq9qB9",
                            "Percentage": 99
                        }
                    }
                },
                "ApplicationId": "<YOUR_APPLICATION_ID>",
                "CreationDate": "2020-07-21T16:56:26.983Z",
                "Id": "0d1a6e240e984396a0b84abf154edc3f",
                "LastModifiedDate": "2020-07-21T17:02:19.832Z",
                "LocalTime": false,
                "Name": "LeJourney",
                "Schedule": {
                    "Timezone": "UTC"
                },
                "StartActivity": "O56tkxsxLV",
                "StartCondition": {
                    "Description": "Entry",
                    "SegmentStartCondition": {
                        "SegmentId": "6f247c535dd042dfbf3af706fabeeee7"
                    }
                },
                "State": "DRAFT"
            }
        ]
    }
}

The above is the output produced when creating a simple journey via UI.

Now, if you create an appropriate update-journey request:

(File: journey.json)
{
    "ApplicationId": "<YOUR_APPLICATION_ID>",
    "JourneyId": "0d1a6e240e984396a0b84abf154edc3f",
    "WriteJourneyRequest": {
        "Activities": {
            "8OoZiq9qB9": {
                "CUSTOM": {
                    "DeliveryUri": "arn:aws:lambda:eu-central-1:<YOUR_APPLICATION_ID>:function:pinpoint-dev-somelambda",
                    "EndpointTypes": [
                        "CUSTOM"
                    ],
                    "MessageConfig": {
                        "Data": "{\"foo\":\"bar\"}"
                    }
                }
            }
        },
        "Name": "LeJourney2",
        "State": "DRAFT",
        "StartActivity": "8OoZiq9qB9",
        "StartCondition": {
            "Description": "Entry",
            "SegmentStartCondition": {
                "SegmentId": "6f247c535dd042dfbf3af706fabeeee7"
            }
        }
    }
}

aws pinpoint update-journey --cli-input-json file://journey.json

It will update your journey accordingly - BUT: the next time the journey is loaded via UI, your MessageConfig is GONE. So it's pretty wonky to use - unless AWS supports setting this via UI (or at least doesn't throw it away), it's pretty much of no use at all, i'm afraid.

Best regards,
Marian Saeger
marian@roadcrew.io

answered 4 years ago
0

That's a real shame. Pinpoint Journeys seem like they could be useful on the surface, but there's just too much low-level do-it-yourself needed to make it work.

Thank you for your reply!

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions