Skip to main content
Member
September 21, 2026
Solved

REST API 7.2.0 synchronous / asynchronous

  • September 21, 2026
  • 4 replies
  • 48 views

Hello OneStream Community,


The REST API documentation indicates that the DataManagement endpoint supports both synchronous and asynchronous execution.
How do we choose between synchronous and asynchronous execution when calling the DataManagement API? Is this determined by the endpoint, a request parameter, or another mechanism?


Thanks in advance for your help.

Best answer by sameburn

That is correct. 

  • StartExecuteSequenceOrStep starts the job and returns immediately. The body includes TaskActivityID. We then use GetTaskActivityStatus to monitor that ID, as per example.. 
  • ExecuteSequenceOrStep starts the same type of job, then the REST call waits. The call returns only when the job ends.

4 replies

Advisor
September 27, 2026

Hi ​@RaphaelV 

From memory, the documentation covers both e.g see examples below

DataManagementSequenceV720 (Synchronous)

DataManagementSequenceAsyncV720 (Asynchronous)

Hope this helps clarify

Sam

Advisor
September 28, 2026

Sorry back at my computer now, so can be more helpful.  The main difference is that we

check that the task has completed successfully by checking TaskActivityStatus

Example below

JsonNode startBody = new JsonObject
{
["SI"] = applicationSi.DeepClone(),
["IsSequence"] = true,
["WorkspaceName"] = workspaceName,
["SequenceOrStepName"] = sequenceName,
["DataManagementGroupName"] = string.Empty,
["CustomSubstVarsAsCommaSeparatedPairs"] = customSubstVars
};

JsonNode started = await PostJsonAsync(
http,
$"{restApiBaseUrl}/api/DataManagement/StartExecuteSequenceOrStep?api-version={apiVersion}",
startBody);

string taskActivityId = started["TaskActivityID"]!.GetValue<string>();

JsonNode status;
do
{
await Task.Delay(TimeSpan.FromSeconds(5));
status = await PostJsonAsync(
http,
$"{restApiBaseUrl}/api/DataManagement/GetTaskActivityStatus?api-version={apiVersion}",
new JsonObject
{
["SI"] = applicationSi.DeepClone(),
["UniqueID"] = taskActivityId
});
}
while (status["IsTaskStillBeingProcessed"]!.GetValue<bool>());

Console.WriteLine(status["TaskActivityStatus"]!.ToJsonString());

 

RaphaelVAuthor
Member
September 28, 2026

Hi Sam, thanks for your reply.

If I understand correctly, StartExecuteSequenceOrStep starts the process asynchronously and returns a TaskActivityID that can be monitored using GetTaskActivityStatus, whereas ExecuteSequence runs synchronously and only returns once the sequence has completed.

Is that correct?

sameburnAdvisorAnswer
Advisor
September 28, 2026

That is correct. 

  • StartExecuteSequenceOrStep starts the job and returns immediately. The body includes TaskActivityID. We then use GetTaskActivityStatus to monitor that ID, as per example.. 
  • ExecuteSequenceOrStep starts the same type of job, then the REST call waits. The call returns only when the job ends.