REST API Reference > Data Integration REST API > Taskflows
  

Taskflows

You can use the REST API to get the status of a taskflow and publish multiple taskflows simultaneously.
For more information about how to run a taskflow as an API, see Running a taskflow as an API.

Monitoring taskflow status with the status resource

If you have the privilege to view job results in Monitor, you can use the status resource to get the status of a taskflow. You can get the status of a taskflow using the taskflow run ID as a path parameter or using query parameters such as run ID, run status, start time, end time, offset, and row limit.

GET request

To get the status of a taskflow using the run ID as a path parameter, use the following URI:
<Informatica Intelligent Cloud Services URL>/active-bpel/services/tf/status/<run ID>
For example:
https://na4.dm.us.informaticacloud.com/active-bpel/services/tf/status/20262247166322413568
You can also get the status of multiple taskflows using query parameters. The query parameters are case sensitive.
You can use the following optional query parameters in the GET request URI:
Field
Description
runId
Run ID for the taskflow.
For example, to get the status of a particular taskflow with a run ID, use the following URI:
https://na4.dm.us.informaticacloud.com/active-bpel/services/tf/status?runId=20262247166322413568
runStatus
Execution status of the taskflow. You can specify the status as Success, Failed, Suspended, or Running.
For example, to get the status of all the taskflows that were successfully executed in the last 24 hours, use the following URl:
https://na4.dm.us.informaticacloud.com/active-bpel/services/tf/status?runStatus=Success
startTime
Start time for the taskflow runs at the beginning of the date and time range. Use Coordinated Universal Time (UTC).
For example, to get the status of all the taskflows that started on or after 2021-06-10T05:48:28Z, use the following URl:
https://na4.dm.us.informaticacloud.com/active-bpel/services/tf/status?startTime=2021-06-10T05:48:28Z
endTime
Start time for the taskflow runs at the end of the date and time range. Use Coordinated Universal Time (UTC).
For example, to get the status of all the taskflows that started between 2021-06-10T05:48:28Z and 2021-06-11T05:48:28Z, use the following URl:
https://na4.dm.us.informaticacloud.com/active-bpel/services/tf/status?startTime=2021-06-10T05:48:28Z&endTime=2021-06-11T05:48:28Z
offset
Number of rows to skip. For example, you might want to skip the first three rows.
rowLimit
Maximum number of rows to return. The maximum number you can specify is 50. If you omit this parameter, the query returns all available rows, up to a maximum of 10 rows.
You can use any combination of these query parameters to get the status of multiple taskflows. For example, you can use the following URI:
<Informatica Intelligent Cloud Services URL>/active-bpel/services/tf/status?startTime=<startTime>&runStatus=<runStatus>&endTime=<endTime>&rowLimit=<rowLimit>
Note: If the startTime or endTime parameters are not used in the query, the response contains status information about the taskflows that ran in the last 24 hours.
Authenticate the GET request in one of the following ways:
Send the request using JSON format. Include the following line in the header: Accept: application/json

GET response

Returns the taskflow status information if successful or an error object if errors occur.
If successful, returns the following status information for a taskflow:
Field
Type
Description
assetName
String
Name of the taskflow.
The taskflow name also includes the custom name, if you had added a custom name to the taskflow using an API or the RunAJob utility.
assetType
String
Type of the object. Returns the value TASKFLOW.
duration
String
Time in seconds that the taskflow ran before it completed, was suspended, was failed, or was stopped.
endTime
Date/time
End time for the taskflow run. Uses Coordinated Universal Time (UTC).
location
String
Project and folder path where the taskflow is located.
runId
Long
Run ID for the taskflow.
runtimeEnv
String
ID of the runtime environment where the taskflow runs.
runtimeEnvName
String
Name of the runtime environment where the taskflow runs.
startTime
Date/time
Start time for the taskflow run. Uses Coordinated Universal Time (UTC).
startedBy
String
User who started the taskflow.
status
String
Execution status of the taskflow.
Returns one of the following values to indicate the taskflow status:
  • - RUNNING. The taskflow is running.
  • - SUCCESS. The taskflow completed successfully.
  • - FAILED. The taskflow did not complete because it encountered errors.
  • - SUSPENDED. The taskflow run was suspended.
subtasks
String
Number of subtasks that the taskflow contains.
updateTime
Date/time
Last time the taskflow run status was updated. Uses Coordinated Universal Time (UTC).
errorMessage
String
Error message string.
subtaskDetails
String
Object that contains status details for all subtasks in the taskflow.
details
String
Status details. Includes status information for each subtask in the tasks object.
tasks
Collection
Status information for all subtasks that the taskflow contains.
The tasks object includes the following status information for each subtask that the taskflow contains:
Field
Type
Description
assetName
String
Name of the subtask in the taskflow.
assetType
String
Type of the subtask. Returns one of the following values:
  • - MTT. Mapping task.
  • - DSS. Synchronization task.
duration
String
Time in seconds that the subtask ran before it completed, was failed, or was stopped.
endTime
Date/time
End time for the subtask run. Uses Coordinated Universal Time (UTC).
errorMessage
String
Error message string.
errorRows
String
Total number of rows that resulted in errors in a subtask.
location
String
Project and folder path where the subtask is located.
rowsProcessed
String
Total number of rows that were processed in a subtask.
runId
Long
Run ID for the subtask.
runtimeEnv
String
ID of the runtime environment where the subtask runs.
runtimeEnvName
String
Name of the runtime environment where the subtask runs.
startTime
Date/time
Start time for the subtask run. Uses Coordinated Universal Time (UTC).
startedBy
String
User who started the task. This field is the same as the user who started the taskflow.
status
String
Execution status of the subtask.
Returns one of the following values to indicate the subtask status:
  • - QUEUED. The subtask is queued on a Secure Agent, but it has not started yet.
  • - STARTING. The subtask is starting.
  • - RUNNING. The subtask is running.
  • - COMPLETED. The subtask completed successfully.
  • - SUSPENDED. The subtaskflow is suspended.
  • - STOPPED. The taskflow has stopped running, so the subtask cannot start.
  • - WARNING. The subtask completed with errors.
  • - FAILED. The subtask did not complete because it encountered errors.
subtasks
String
Reserved for future use. When this field is returned for a subtask, the value is always 0.
successRows
String
Total number of rows that were processed successfully in a subtask.
updateTime
Date/time
Last time the subtask run status was updated. Uses Coordinated Universal Time (UTC).
You might receive one of the following responses:
Response
Description
Purged logs
If logs are purged for the instance, the response is as follows:
{ "status": "No status available." }
The HTTP status code is 200 OK.
Invalid run ID
If the run ID is not valid, the response is as follows:
{
"error": "CMN_003-Bad request. Error message - The property '<runID>', used in a query expression, is not defined in type 'OData.job-log-service.JobLogEntry'."
}
The HTTP status code is 400 Bad Request(From JLS).
Invalid filter clause
If the parameter value is not valid, the response is as follows:
{
"error": "JLS_007-Invalid Filter clause in OData request. RawURI = http://internal-na1-elb.infacloudops.net:443/jls-di/internal/api/v1"
}
The HTTP status code is 400 Bad Request(From JLS).
Unavailable JLS service
If the JLS service is unavailable, the response is as follows:
{ "error": "503-Service Unavailable." }
The HTTP status code is 503 Service Unavailable.

GET example using the run ID as a path parameter

The following example shows a taskflow status request that uses the run ID as a path parameter:
GET https://pod.ics.dev:444/active-bpel/services/tf/status/20262247166322413568
Accept: application/json
INFA-SESSION-ID: 9KA11tLGqxVcGeul8SQBK3
Based on the taskflow configuration and request inputs, the response can be of the following types:
Taskflow without subtasks
If the request is successful and the taskflow does not contain subtasks, the response includes taskflow status information as shown in the following example:
{
"assetName": "Taskflow1",
"assetType": "TASKFLOW",
"duration": "2",
"endTime": "2018-12-25T15:56:39Z",
"location": "Default",
"runId": "262247166322413568",
"runtimeEnv": "tf_runtime",
"runtimeEnvName": "",
"startTime": "2018-12-25T15:56:37Z",
"startedBy": "sb",
"status": "SUCCESS",
"subtasks": "0",
"updateTime": "2018-12-25T15:56:39Z",
"errorMessage": {},
"subtaskDetails": {
"details": {}
}
}
The HTTP status code is 200 OK.
Taskflow with subtasks
If the request is successful and the taskflow contains multiple subtasks, the response includes status information for each subtask that the taskflow contains as shown in the following example:
{
"assetName": "Taskflow2",
"assetType": "TASKFLOW",
"duration": "89",
"endTime": "2018-12-23T17:25:16Z",
"location": "Default",
"runId": 20262247166322413568,
"runtimeEnv": "tf_runtime",
"runtimeEnvName": "",
"startTime": "2018-12-23T17:23:47Z",
"startedBy": "sb",
"status": "SUCCESS",
"subtasks": "2",
"updateTime": "2018-12-23T17:25:17Z",
"errorMessage": {},
"subtaskDetails": {
"details": {
"tasks": [
{
"assetName": "MTR",
"assetType": "MTT",
"duration": "3",
"endTime": "2018-12-23T17:24:45Z",
"errorMessage": "",
"errorRows": "0",
"location": "Default",
"rowsProcessed": "7",
"runId": "4",
"runtimeEnv": "01001Q25000000000002",
"runtimeEnvName": "tf_runtime_devagent",
"startTime": "2018-12-23T17:24:42Z",
"startedBy": "sb",
"status": "COMPLETED",
"subtasks": "0",
"successRows": "7",
"updateTime": "2018-12-23T17:24:46Z"
},
{
"assetName": "MTR",
"assetType": "MTT",
"duration": "10",
"endTime": "2018-12-23T17:23:59Z",
"errorMessage": "",
"errorRows": "0",
"location": "Default",
"rowsProcessed": "7",
"runId": "3",
"runtimeEnv": "01001Q25000000000002",
"runtimeEnvName": "tf_runtime_devagent",
"startTime": "2018-12-23T17:23:49Z",
"startedBy": "sb",
"status": "COMPLETED",
"subtasks": "0",
"successRows": "7",
"updateTime": "2018-12-23T17:24:00Z"
}
]
}
}
}
The HTTP status code is 200 OK.

GET example using query parameters

The following example shows a taskflow status request that uses run ID, run status, and row limit as query parameters:
GET https://pod.ics.dev:444/active-bpel/services/tf/status?runId=20262247166322413568&runStatus=Success&rowLimit=3
Accept: application/json
INFA-SESSION-ID: 9KA11tLGqxVcGeul8SQBK3
If the request is successful, the response format is the same as when we use the path parameter, but within square brackets [ ].
If the request is successful and the taskflow does not contain subtasks, the response includes taskflow status information as shown in the following example:
[
{
"assetName": "Taskflow1",
"assetType": "TASKFLOW",
"duration": "2",
"endTime": "2018-12-25T15:56:39Z",
"location": "Default",
"runId": 262247166322413568,
"runtimeEnv": "tf_runtime",
"runtimeEnvName": "",
"startTime": "2018-12-25T15:56:37Z",
"startedBy": "sb",
"status": "SUCCESS",
"subtasks": "0",
"updateTime": "2018-12-25T15:56:39Z",
"errorMessage": {},
"subtaskDetails": {
"details": {
"tasks": []
}
}
}
]
The HTTP status code is 200 OK.

GET example without any parameter

The following example shows a taskflow status request without a path parameter or query parameter:
<Informatica Intelligent Cloud Services URL>/active-bpel/services/tf/status
The response contains status information of the last 10 taskflows that were run in the last 24 hours.

GET example of a running taskflow

If you use the status resource to get the status of a running taskflow, the response includes taskflow status information with the endTime as null without quotes as shown in the following example:
{
"assetName": "waitStatus",
"assetType": "TASKFLOW",
"duration": 27,
"endTime": null,
"errorMessage": "",
"location": "Default",
"runId": 737194191850250240,
"runtimeEnv": "taskflow-preview-usw1-r40-app02.infacloudops.net:4430",
"runtimeEnvName": "",
"startedBy": "sb",
"startTime": "2022-07-28T06:26:32Z",
"status": "RUNNING",
"subtasks": 0,
"updateTime": "2022-07-28T06:26:32Z",
"subtaskDetails": {
"details": {
"tasks": []
}
}
}
After the taskflow is complete, the correct endTime value is displayed.

Publishing taskflows in bulk

You can use the publish resource to publish a single taskflow or multiple taskflows simultaneously and save time.
The taskflows are published in the same order as given in the request payload. You can publish a maximum of 199 taskflows at a time.
    1In a REST client, use a POST request with the following URL:
    <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/publish
    For example: https://na1.dm-us.informaticacloud.com/active-bpel/asset/v1/publish
    2Add the following headers:
    Key
    Value
    Accept
    application/vnd.api+json
    Content-Type
    application/vnd.api+json
    INFA-SESSION-ID
    Use the login resource to get the session ID. For more information about the login resource, see REST API Reference.
    3In the body, use the assetPaths attribute to specify one or more locations and names of the taskflows that you want to publish.
    Use the following format:
    {
    "data": {
    "type": "publish",
    "attributes": {
    "assetPaths": [
    "Explore/<location-of-taskflow1>/<name-of-taskflow1>.TASKFLOW.xml",
    "Explore/<location of taskflow2>/<name-of-taskflow2>.TASKFLOW.xml",
    "Explore/<location-of-taskflown>/<name-of-taskflown>.TASKFLOW.xml"
    ]
    }
    }
    }
    4Send the POST request.
    You see a publish ID and a success or failure response. If the request fails, the response also gives the error details.
    The following snippet shows a sample response:
    {
    "data": {
    "type": "publish",
    "id": "690487059198201856",
    "attributes": {
    "jobState": "NOT_STARTED",
    "jobStatusDetail": {},
    "startedBy": "autouser_pod1",
    "startDate": "2022-03-21T09:09:04.000+0000",
    "totalCount": 1,
    "processedCount": 0,
    "assetPaths": [
    "Explore/Pavan/BulkPublishApi/BPTaskflow1.TASKFLOW.xml"
    ]
    }
    },
    "links": {
    "self": https://na1.dm-us.informaticacloud.com/active-bpel/asset/v1/publish/690487059198201856,
    "status": https://na1.dm-us.informaticacloud.com/active-bpel/asset/v1/publish/690487059198201856/Status
    }
    }
    The publish ID in this example is 690487059198201856.
    5To view information about the publish status and publish job, use a GET request with the following URLs:
    URL
    Description
    <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/publish/<publishId>/Status
    Displays the publish status.
    <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/publish/<publishId>
    Displays the publish job information.

Unpublishing taskflows in bulk

You can use the unpublish resource to unpublish a single taskflow or multiple taskflows simultaneously and save time.
The taskflows are unpublished in the same order as given in the request payload. You can unpublish a maximum of 199 taskflows at a time.
    1In a REST client, use a POST request with the following URL:
    <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/unpublish
    For example: https://na1.dm-us.informaticacloud.com/active-bpel/asset/v1/unpublish
    2Add the following headers:
    Key
    Value
    Accept
    application/vnd.api+json
    Content-Type
    application/vnd.api+json
    INFA-SESSION-ID
    Use the login resource to get the session ID. For more information about the login resource, see REST API Reference.
    3In the body, use the assetPaths attribute to specify one or more locations and names of the taskflows that you want to unpublish.
    Use the following format:
    {
    "data": {
    "type": "unpublish",
    "attributes": {
    "assetPaths": [
    "Explore/<location-of-taskflow1>/<name-of-taskflow1>.TASKFLOW.xml",
    "Explore/<location of taskflow2>/<name-of-taskflow2>.TASKFLOW.xml",
    "Explore/<location-of-taskflown>/<name-of-taskflown>.TASKFLOW.xml"
    ]
    }
    }
    }
    4Send the POST request.
    You see an unpublish job ID and a success or failure response. If the request fails, the response also gives the error details.
    The following snippet shows a sample response:
    {
    "data": {
    "type": "unpublish",
    "id": "7645874567965431",
    "attributes": {
    "jobState": "NOT_STARTED",
    "jobStatusDetail": {},
    "startedBy": "autouser_pod1",
    "startDate": "2022-03-21T09:09:04.000+0000",
    "totalCount": 1,
    "processedCount": 0,
    "assetPaths": [
    "Explore/Pavan/BulkUnpublishApi/BPTaskflow1.TASKFLOW.xml"
    ]
    }
    },
    "links": {
    "self": https://na1.dm-us.informaticacloud.com/active-bpel/asset/v1/unpublish/7645874567965431,
    "status": https://na1.dm-us.informaticacloud.com/active-bpel/asset/v1/unpublish/7645874567965431/Status
    }
    }
    The unpublish job ID in this example is 7645874567965431.
    5To view information about the unpublish status and unpublish job, use a GET request with the following URLs:
    URL
    Description
    <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/unpublish/<unpublishId>/Status
    Displays the unpublish status.
    <Informatica Intelligent Cloud Services URL>/active-bpel/asset/v1/unpublish/<unpublishId>
    Displays the unpublish job information.