Skip to content

Treasure Workflow (1.0)

Treasure Workflow

Download OpenAPI description
Languages
Servers
Mock server
https://docs.treasuredata.com/_mock/apis/workflow
aws
https://api-workflow.treasuredata.com
aws-tokyo
https://api-workflow.treasuredata.co.jp
eu01
https://api-workflow.eu01.treasuredata.com
ap02
https://api-workflow.ap02.treasuredata.com
ap03
https://api-workflow.ap03.treasuredata.com

Attempt

Operations

List attempts with filters

Request

Security
ApiKeyAuth
Query
projectstring

exact matching filter on project name

workflowstring

exact matching filter on workflow name

include_retriedboolean

list more than 1 attempts per session

last_idinteger(int64)

List attempts whose ID is smaller than this ID for pagination. Attempts are returned in descending order by ID.

page_sizeinteger(int32)

number of attempts to return

curl -i -X GET \
  'https://docs.treasuredata.com/_mock/apis/workflow/api/attempts?project=string&workflow=string&include_retried=true&last_id=0&page_size=0' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'

Responses

default response

Bodyapplication/json
attemptsArray of objects(RestSessionAttempt)
Response
application/json
{ "attempts": [ {} ] }

Start a workflow execution as a new session or a new attempt of an existing session

Request

"resume" is used to rerun an attempt. It is used in the case an attempt failed then users want to resume it from the middle.It has two modes "failed" or "from" to set the way to resume.In "failed" mode, the attempt specified by "attemptId" is resumed from the failed tasks.In "from" mode, the attempt is resumed from the task which is set in "from" field.

Security
ApiKeyAuth
Bodyapplication/json
allowQueueingboolean

Whether an attempt can be queued when the maximum attempt limit is reached.

paramsobjectrequired

parameters as json

Example: {"key1":12345}
projectNamestring

project name. workflowId or (projectName and workflowName) are required

Example: "project-a"
resumeobject(Resume)

Configuration to resume an attempt. {"mode": "failed", "attemptId": "12345"} or {"mode": "from", "attemptId": "12345", "from": "+t1"}

retryAttemptNamestring

unique attempt name for retry

sessionTimestring(date-time)required

session time

Example: "2023-08-17T18:56:24+09:00"
workflowIdstring

workflow ID. workflowId or (projectName and workflowName) are required

Example: "123456"
workflowNamestring

workflow name. workflowId or (projectName and workflowName) are required

Example: "workflow-a"
curl -i -X PUT \
  https://docs.treasuredata.com/_mock/apis/workflow/api/attempts \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "allowQueueing": true,
    "params": {
      "key1": 12345
    },
    "projectName": "project-a",
    "resume": {
      "mode": "from",
      "attemptId": "12345",
      "from": "string"
    },
    "retryAttemptName": "string",
    "sessionTime": "2023-08-17T18:56:24+09:00",
    "workflowId": "123456",
    "workflowName": "workflow-a"
  }'

Responses

return an attempt

Bodyapplication/json
cancelRequestedbooleanrequired

true if kill requested

createdAtstring(date-time)required

created time

Example: "2023-08-18T06:52:33Z"
donebooleanrequired

true if the attempt finished

finishedAtstring(date-time)

finished time

Example: "2023-08-18T06:52:33Z"
idstringrequired

attempt ID

Example: "123456"
indexinteger(int32)required

index for multiple attempts

Example: 1
paramsobjectrequired

passed parameters as JSON

poolIdstring

ID of the pool to which this attempt is assigned.

Example: "42"
projectobject(IdAndName)required

Name and ID

project.​idstringrequired

ID

Example: "123456"
project.​namestringrequired

name

Example: "abcdefg"
retryAttemptNamestringrequired

attempt name for retry

Example: "retry-12345"
sessionIdstringrequired

session ID

Example: "123456"
sessionTimestringrequired

session time

Example: "2022-12-31T23:59:00+00:00"
sessionUuidstring(uuid)required

unique UUID of this session

Example: "2b91a014-076e-4c6d-8b51-f4f91089cab2"
statusstringrequired

The current status of the attempt.

Enum"queued""running""canceling""success""error""killed"
Example: "running"
successbooleanrequired

true if the attempt finished successfully

workflowobject(NameOptionalId)required

Name and optional ID

workflow.​idstring

ID

Example: "123456"
workflow.​namestringrequired

name

Example: "abcdefg"
Response
application/json
{ "cancelRequested": true, "createdAt": "2023-08-18T06:52:33Z", "done": true, "finishedAt": "2023-08-18T06:52:33Z", "id": "123456", "index": 1, "params": {}, "poolId": "42", "project": { "id": "123456", "name": "abcdefg" }, "retryAttemptName": "retry-12345", "sessionId": "123456", "sessionTime": "2022-12-31T23:59:00+00:00", "sessionUuid": "2b91a014-076e-4c6d-8b51-f4f91089cab2", "status": "running", "success": true, "workflow": { "id": "123456", "name": "abcdefg" } }

Get an attempt

Request

Security
ApiKeyAuth
Path
idinteger(int64)required

attempt id

curl -i -X GET \
  'https://docs.treasuredata.com/_mock/apis/workflow/api/attempts/{id}' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'

Responses

default response

Bodyapplication/json
cancelRequestedbooleanrequired

true if kill requested

createdAtstring(date-time)required

created time

Example: "2023-08-18T06:52:33Z"
donebooleanrequired

true if the attempt finished

finishedAtstring(date-time)

finished time

Example: "2023-08-18T06:52:33Z"
idstringrequired

attempt ID

Example: "123456"
indexinteger(int32)required

index for multiple attempts

Example: 1
paramsobjectrequired

passed parameters as JSON

poolIdstring

ID of the pool to which this attempt is assigned.

Example: "42"
projectobject(IdAndName)required

Name and ID

project.​idstringrequired

ID

Example: "123456"
project.​namestringrequired

name

Example: "abcdefg"
retryAttemptNamestringrequired

attempt name for retry

Example: "retry-12345"
sessionIdstringrequired

session ID

Example: "123456"
sessionTimestringrequired

session time

Example: "2022-12-31T23:59:00+00:00"
sessionUuidstring(uuid)required

unique UUID of this session

Example: "2b91a014-076e-4c6d-8b51-f4f91089cab2"
statusstringrequired

The current status of the attempt.

Enum"queued""running""canceling""success""error""killed"
Example: "running"
successbooleanrequired

true if the attempt finished successfully

workflowobject(NameOptionalId)required

Name and optional ID

workflow.​idstring

ID

Example: "123456"
workflow.​namestringrequired

name

Example: "abcdefg"
Response
application/json
{ "cancelRequested": true, "createdAt": "2023-08-18T06:52:33Z", "done": true, "finishedAt": "2023-08-18T06:52:33Z", "id": "123456", "index": 1, "params": {}, "poolId": "42", "project": { "id": "123456", "name": "abcdefg" }, "retryAttemptName": "retry-12345", "sessionId": "123456", "sessionTime": "2022-12-31T23:59:00+00:00", "sessionUuid": "2b91a014-076e-4c6d-8b51-f4f91089cab2", "status": "running", "success": true, "workflow": { "id": "123456", "name": "abcdefg" } }

Set a cancel-requested flag on a running attempt

Request

Security
ApiKeyAuth
Path
idinteger(int64)required

attempt id

curl -i -X POST \
  'https://docs.treasuredata.com/_mock/apis/workflow/api/attempts/{id}/kill' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'

Responses

return an attempt

Bodyapplication/json
cancelRequestedbooleanrequired

true if kill requested

createdAtstring(date-time)required

created time

Example: "2023-08-18T06:52:33Z"
donebooleanrequired

true if the attempt finished

finishedAtstring(date-time)

finished time

Example: "2023-08-18T06:52:33Z"
idstringrequired

attempt ID

Example: "123456"
indexinteger(int32)required

index for multiple attempts

Example: 1
paramsobjectrequired

passed parameters as JSON

poolIdstring

ID of the pool to which this attempt is assigned.

Example: "42"
projectobject(IdAndName)required

Name and ID

project.​idstringrequired

ID

Example: "123456"
project.​namestringrequired

name

Example: "abcdefg"
retryAttemptNamestringrequired

attempt name for retry

Example: "retry-12345"
sessionIdstringrequired

session ID

Example: "123456"
sessionTimestringrequired

session time

Example: "2022-12-31T23:59:00+00:00"
sessionUuidstring(uuid)required

unique UUID of this session

Example: "2b91a014-076e-4c6d-8b51-f4f91089cab2"
statusstringrequired

The current status of the attempt.

Enum"queued""running""canceling""success""error""killed"
Example: "running"
successbooleanrequired

true if the attempt finished successfully

workflowobject(NameOptionalId)required

Name and optional ID

workflow.​idstring

ID

Example: "123456"
workflow.​namestringrequired

name

Example: "abcdefg"
Response
application/json
{ "cancelRequested": true, "createdAt": "2023-08-18T06:52:33Z", "done": true, "finishedAt": "2023-08-18T06:52:33Z", "id": "123456", "index": 1, "params": {}, "poolId": "42", "project": { "id": "123456", "name": "abcdefg" }, "retryAttemptName": "retry-12345", "sessionId": "123456", "sessionTime": "2022-12-31T23:59:00+00:00", "sessionUuid": "2b91a014-076e-4c6d-8b51-f4f91089cab2", "status": "running", "success": true, "workflow": { "id": "123456", "name": "abcdefg" } }

List attempts of a session of a given attempt

Request

Security
ApiKeyAuth
Path
idinteger(int64)required

attempt id

curl -i -X GET \
  'https://docs.treasuredata.com/_mock/apis/workflow/api/attempts/{id}/retries' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'

Responses

default response

Bodyapplication/json
attemptsArray of objects(RestSessionAttempt)
Response
application/json
{ "attempts": [ {} ] }

List tasks of an attempt

Request

Security
ApiKeyAuth
Path
idinteger(int64)required

attempt id

curl -i -X GET \
  'https://docs.treasuredata.com/_mock/apis/workflow/api/attempts/{id}/tasks' \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'

Responses

default response

Bodyapplication/json
tasksArray of objects(RestTask)
Response
application/json
{ "tasks": [ {} ] }

Log

Operations

Project

Operations

Schedule

Operations

Session

Operations

Workflow

Operations