Journey Walkthrough
⚠️ Alpha: Please note journeys are in an early stage of development and are subject to change.
On this page, we have a walkthrough showing how to use a journey in an end to end process. The sample journey will create a set of person cases, run an AML check against each case, and finally retrieve basic profile details for all results returned by the KYC checks.
In this walkthrough, we will start a new journey, supply the cases we want to create, check on the status of our journey and retrieve its outputs.
Definition
We will be starting a journey that uses the sample definition shown below.
{
"Definition": {
"Name": "Sample",
"Inputs": [
{
"Name": "MyCases",
"Type": "CaseCollection"
}
],
"Outputs": null,
"Views": []
},
"Stages": [
{
"Name": "Create Cases",
"RunnerId": "BulkCaseCreationRunner",
"Index": 0,
"RetryCount": 1,
"Inputs": [
{
"JourneyInputIndex": 0
}
]
},
{
"Name": "KYC",
"RunnerId": "W2KycRunner",
"Index": 1,
"RetryCount": 1,
"Settings": {
"BundleName": "W2_DATA_PEP_AND_SANCTION_006"
},
"Inputs": [
{
"StageIndex": 0,
"OutputIndex": 0
}
]
},
{
"Name": "Profile Details Enrichment",
"RunnerId": "ProfileDetailsEnrichmentRunner",
"Index": 2,
"RetryCount": 1,
"Settings": {
"BundleName": "BasicProfileDetailsBundle"
},
"Inputs": [
{
"StageIndex": 1,
"OutputIndex": 0
}
]
}
]
}
Starting a new journey
To start a new journey, submit the following request, specifying the definition name. Any tags you supply will be stored against your journey, but will not affect its behaviour.
Request
POST https://api-qa.w2globaldata.com/journeys/start
{
"DefinitionName": "Sample",
"Tags":
{
"Batch": "1024"
}
}
Response
As a response, you will recieve the unique identifier for your newly created journey. You journey will begin running asynchronously on our journey engine.
{
"Id": "00000000-0000-0000-0000-000000000000"
}
Query the journey status
You can now query your new journey for its status using the the following request. In this journey, you will notice that none of the stages are running. This is because each stage is dependent on the previous, and the first stage is dependent on a journey input. As such an input is externally supplied, the journey will wait until the data is available.
Request
Replace {Journey ID} with your journey identifier.
GET https://api.w2globaldata.com/journeys/status/{Journey ID}
Response
{
"Id": "00000000-0000-0000-0000-000000000000",
"DefinitionName": "Sample",
"Views": [],
"StartTimestamp": "2025-01-11T00:00:00.0000000Z",
"UpdatedTimestamp": "2025-01-11T00:00:00.0000000Z",
"Status": "Running",
"Stages": [
{
"Index": 0,
"RunnerId": "BulkCaseCreationRunner",
"Name": "Create Cases",
"State": "NotStarted",
"Synchronous": false,
"Inputs": [
{
"JourneyInputIndex": 0,
"MultiCast": false,
"StageIndex": 0,
"OutputIndex": 0
}
]
},
{
"Index": 1,
"RunnerId": "W2KycRunner",
"Name": "KYC",
"State": "NotStarted",
"Synchronous": false,
"Inputs": [
{
"MultiCast": false,
"StageIndex": 0,
"OutputIndex": 0
}
]
},
{
"Index": 2,
"RunnerId": "ProfileDetailsEnrichmentRunner",
"Name": "Profile Details Enrichment",
"State": "NotStarted",
"Synchronous": false,
"Inputs": [
{
"MultiCast": false,
"StageIndex": 1,
"OutputIndex": 0
}
]
}
],
"Tags": {
"Batch": "1024"
}
}
Supply Input
To get our journey to resume running, we must supply a list of the cases we would like to create. We can use the following endpoint to provide the data. The journey will then resume and run its three stages automatically.
Request
You should replace {Input Name} with the name of the input you wish to supply data to. The name is defined on the defintion. In this case, we would use "MyCases".
POST https://api-qa.w2globaldata.com/journeys/{Journey ID}/input/{Input Name}
{
"Cases": [
{ "Forename": "Donald", "Surname": "Trump", "ClientReference": "myCaseToCheck" }
]
}
Response
You should recieve a 204 response, with no data. The journey will now consume the supplied data and any dependent stages will resume running automatically. If you now query the status of your journey, the three stages should now run to completion.
Get Output
Journey stages may produce data as an output. This data is a JSON blob and can be retrieved with the following endpoint. The data will only be available once the stage is complete.
Request
Stage index specifies the index of the stage we want to access. Output index specifies which output from the stage we want returned. In this example, we could use 2 and 0 respectively to access the basic profile information.
POST https://api-qa.w2globaldata.com/journeys/{Journey ID}/output/{Stage Index}/{Output Index}
Response
Response has been truncated for brevity.
{
"WC0000000": {
"ClientReference": "JourneyServiceProfileDetailsEnrichment",
"Results": {
"ProfileDetailsResult": {
"W2DataPepAndSanction006DetailsResult": {
}
}
}
}
}