Skip to main content
All CollectionsAPI Documentation
Launch Activities - Wrk API Reference
Launch Activities - Wrk API Reference

Interfacing with the Wrk Platform via APIs - Wrkflow Launches Activities

David Li avatar
Written by David Li
Updated over a month ago

Launches Activities

This object represents an Activity occurring in a Wrkflow launch. Use it to get updates on the progress of a Launch and respond to user input requests from the Wrkflow Launch.

ENDPOINTS

GET

/v1/launch/<launch_id>/get-activities

POST

/v1/launch/<launch_id>/respond-to-question

The Activity object

Attributes

Attributes

The Activity object

  • activity_id string
    The unique identifier of the Launch Activity

  • launch_id int
    The unique identifier of the Launch that the Activity belongs to

  • posted_date unix date
    The start date of the Launch.

  • message string
    The content of the posted message. Can be plain text, markdown, HTML.

  • activity_type string
    The type of activity posted

    • info

    • debug

    • question

    • system

    • error

  • attachments list of URI
    A list of URI. The URI will point to a downloadable file that was produced as part of the Wrkflow launch.

{
"activity_id": "322123/000000000000001",
"launch_id": 322123,
"posted_date": 1728675432,
"message": "Hello world",
"activity_type": "info",
"attachments": []
}


Retrieve Launch Activities

Retrieves the activities posted by the Launch. The activities are messages posted to the Launch Console. These are dependent on the design of the workflow or posted by the system in events such as errors or credit status.

Parameters

  • launch_id int
    The unique identifier of the Launch Activities to retrieve

  • activity_id string (optional)
    The unique identifier of the Activity

  • activity_type string (optional)
    The activity matching the type info, debug, question, system, error

  • lower_posted_date unix date (optional)
    The Activities that have a posted date bigger or equal to

  • upper_posted_date unix date (optional)
    The Activities that have a posted date smaller or equal to

  • sort_order string (optional)
    The list is sorted by posted_date in either newest first DESC or oldest first ASC. The default is DESC
    โ€‹

GET /v1/launch/<launch_id>/get-activities

cURL

x

Python

...

# Start with a Launch object
launch = wrkflow.get_launches(
launch_id = 123
)

# Getting the info activities
info_activities = launch.get_activities(
activity_type = "info"
)

# Getting all activities
all_activities = launch.activities

Returns

A dictionary with property activities containing an array of activity object. The totalCount property will give the number of Activities returned. If there are no Activities matching the request, the resulting array will be empty

{
"totalCount": 2,
"activities": [
{
"activity_id": "322123/000000000000001",
"launch_id": 322123,
"posted_date": 1728675432,
"message": "Hello world",
"activity_type": "info",
"attachments": []
},
{
"activity_id": "322123/000000000000002",
"launch_id": 322123,
"posted_date": 1728343992,
"message": "Here are your reports",
"activity_type": "info",
"attachments": [
"https://somewhere/file.xls",
"https://somewhere/report.ppt"
]
}
]
}

Respond to (Activity) Question

An Activity of activity_type with type question, is a request to get user input - question. that is generated by the workflow and the workflow will expect a response back - answer, to continue its execution. Using the Respond to Question allows to send the answer back to the question.

The questions come usually have a timeout value that is set in the workflow, and the resulting action if no answer is received is also set in the workflow. The timeout value is not accessible through API.

A posted answer to a question will be passed back to the workflow, that will handle the next steps. The API does not offer insights on the flow within a Wrkflow.

The answer is always collected as a string type. Handling the content or converting to different data type is handled in the workflow. The answer can be in a form of a JSON schema where the data type can be specified if needed.

A question can only be responded to once. Any subsequent answer to the same question will be acknowledged by the API, but ignored by the workflow.

Parameters

  • activity_id string
    The unique identifier of the Activity.

  • answer string
    The returned answer to the user input request.

POST /v1/launch/<launch_id>/respond-to-question

cURL

curl -P /v1/launch/<launch_id>/respond-to-question

x

Python

...

launch = wrkflow.get_launches(launch_id=1234)

# Getting the question activity
question_activity = launch.get_activities(
activity_id = "123/0003"
)

question_activity.respond_to_question(
answer = "Yes"
)

Returns

If successful, a dictionary with Boolean property status where true denotes a successful receipt of the answer.

{ "status": true }

Did this answer your question?