0

I have a question with Journey Builder . I'm trying to stack a log regarding the journey and I realized there aren't any reference about how to extract the "journey stopped date".

I'm currently extracting Journey published date with _JourneyActivity dataview, but I was wondering if there's any way to extract the JOurney's stopped date.

If anyone has an idea with it,it'd be a great help THank you in advance

2 Answers 2

3

I have not fully vetted this as a universal solve for this specific issue, but I have seen it be successful in a few similar areas.

There is a REST API to 'audit' a journey. This will have an entry with a timestamp for an action of 'Stop' that should give you the info you need.

GET /interaction/v1/interactions/{{journeyID}}/audit/all
Host: {{tenantSubDomain}}.rest.marketingcloudapis.com
Content-Type: application/json
Authorization: Bearer {{auth_Token}}

This returns an object with an array of 'items' in it that are each of the relevant events (Publish, Stop, Modify, etc) that you can iterate through to find the one with "action" of "Stop" and the corresponding timestamp should give you the date you need.

Sample of Return:

{
    "count": 6,
    "page": 1,
    "pageSize": 50,
    "links": {},
    "items": [
        {
            "id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
            "action": "Stop",
            "user": {
                "name": "sample",
                "userId": 123456
            },
            "timeStamp": "2021-03-23T10:42:10.98",
            "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "versionNumber": 1,
            "originalDefinitionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "name": "Sample",
            "description": "",
            "contactsEjected": 6
        },
        {
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "action": "Publish",
            "user": {
                "name": "sample",
                "userId": 123456
            },
            "timeStamp": "2021-03-23T10:40:24.977",
            "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "versionNumber": 1,
            "originalDefinitionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "name": "Sample",
            "description": "",
            "executionMode": "Production",
            "publishStatus": "PublishCompleted",
            "publishRequestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        },
       ...
    ]
}

As you can see, this also returns the version number, which will help when your journey has multiple journey versions that stopped.

1

Once the journey's version is stopped, you cannot change anything inside that will lead to the update of the ModifiedDate field, thus you can retrieve that with a simple query to the _Journey Data View:

SELECT
JourneyName,
VersionNumber,
ModifiedDate,
JourneyStatus
FROM _Journey
WHERE JourneyName = 'xxx' AND JourneyStatus = 'Stopped'

One thing to remember is that _Journey Data View also keeps deleted journeys and that would be the only way of updating the stopped journey's ModifiedDate field for all its versions but then the status would be also "Deleted", that is why JourneyStatus = 'Stopped' will prevent the confusion.

2
  • Hello Niko Thanks for the details. I've thought the same way, but I found out that once the Journey's version is updated, the previous version's ModifiedDate is also updated as the same date of newest version's LastPublishedDate. What I need is the exact StoppedDate of each Journey's version, so I wonder if you could give me another good tip regarding it.
    – Lilyn
    Apr 25, 2022 at 0:32
  • Hello @Lilyn, indeed, totally missed that part with versioning. Then it seems there is no clean solution since API does not bring any new information either. So that you can try to set up a script or SQL to run frequently and check journeys ModifiedDate and Status and once it is "Stopped" to save the ModifiedDate, although it is not a reliable approach.
    – Niko
    Apr 25, 2022 at 9:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .