Skip to content

Latest commit

 

History

History
1325 lines (974 loc) · 107 KB

File metadata and controls

1325 lines (974 loc) · 107 KB

Workflows.Executions

Overview

Available Operations

getWorkflowExecution

Get Workflow Execution

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecution({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecution } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecution.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecution(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecution failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionV1WorkflowsExecutionsExecutionIdGetRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.WorkflowExecutionResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

getWorkflowExecutionHistory

Get Workflow Execution History

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecutionHistory({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecutionHistory } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecutionHistory.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecutionHistory(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecutionHistory failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIdHistoryGetRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<any>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

signalWorkflowExecution

Signal Workflow Execution

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.signalWorkflowExecution({
    executionId: "<id>",
    signalInvocationBody: {
      name: "<value>",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsSignalWorkflowExecution } from "@mistralai/mistralai/funcs/workflowsExecutionsSignalWorkflowExecution.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsSignalWorkflowExecution(mistral, {
    executionId: "<id>",
    signalInvocationBody: {
      name: "<value>",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsSignalWorkflowExecution failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIdSignalsPostRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.SignalWorkflowResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

queryWorkflowExecution

Query Workflow Execution

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.queryWorkflowExecution({
    executionId: "<id>",
    queryInvocationBody: {
      name: "<value>",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsQueryWorkflowExecution } from "@mistralai/mistralai/funcs/workflowsExecutionsQueryWorkflowExecution.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsQueryWorkflowExecution(mistral, {
    executionId: "<id>",
    queryInvocationBody: {
      name: "<value>",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsQueryWorkflowExecution failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIdQueriesPostRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.QueryWorkflowResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

terminateWorkflowExecution

Terminate Workflow Execution

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  await mistral.workflows.executions.terminateWorkflowExecution({
    executionId: "<id>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsTerminateWorkflowExecution } from "@mistralai/mistralai/funcs/workflowsExecutionsTerminateWorkflowExecution.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsTerminateWorkflowExecution(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    
  } else {
    console.log("workflowsExecutionsTerminateWorkflowExecution failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIdTerminatePostRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

batchTerminateWorkflowExecutions

Batch Terminate Workflow Executions

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.batchTerminateWorkflowExecutions({
    executionIds: [
      "<value 1>",
      "<value 2>",
    ],
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsBatchTerminateWorkflowExecutions } from "@mistralai/mistralai/funcs/workflowsExecutionsBatchTerminateWorkflowExecutions.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsBatchTerminateWorkflowExecutions(mistral, {
    executionIds: [
      "<value 1>",
      "<value 2>",
    ],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsBatchTerminateWorkflowExecutions failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request components.BatchExecutionBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.BatchExecutionResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

cancelWorkflowExecution

Cancel Workflow Execution

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  await mistral.workflows.executions.cancelWorkflowExecution({
    executionId: "<id>",
  });


}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsCancelWorkflowExecution } from "@mistralai/mistralai/funcs/workflowsExecutionsCancelWorkflowExecution.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsCancelWorkflowExecution(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    
  } else {
    console.log("workflowsExecutionsCancelWorkflowExecution failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIdCancelPostRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

batchCancelWorkflowExecutions

Batch Cancel Workflow Executions

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.batchCancelWorkflowExecutions({
    executionIds: [],
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsBatchCancelWorkflowExecutions } from "@mistralai/mistralai/funcs/workflowsExecutionsBatchCancelWorkflowExecutions.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsBatchCancelWorkflowExecutions(mistral, {
    executionIds: [],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsBatchCancelWorkflowExecutions failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request components.BatchExecutionBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.BatchExecutionResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

resetWorkflow

Reset Workflow

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  await mistral.workflows.executions.resetWorkflow({
    executionId: "<id>",
    resetInvocationBody: {
      eventId: 24149,
    },
  });


}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsResetWorkflow } from "@mistralai/mistralai/funcs/workflowsExecutionsResetWorkflow.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsResetWorkflow(mistral, {
    executionId: "<id>",
    resetInvocationBody: {
      eventId: 24149,
    },
  });
  if (res.ok) {
    const { value: result } = res;
    
  } else {
    console.log("workflowsExecutionsResetWorkflow failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ResetWorkflowV1WorkflowsExecutionsExecutionIdResetPostRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

updateWorkflowExecution

Update Workflow Execution

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.updateWorkflowExecution({
    executionId: "<id>",
    updateInvocationBody: {
      name: "<value>",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsUpdateWorkflowExecution } from "@mistralai/mistralai/funcs/workflowsExecutionsUpdateWorkflowExecution.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsUpdateWorkflowExecution(mistral, {
    executionId: "<id>",
    updateInvocationBody: {
      name: "<value>",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsUpdateWorkflowExecution failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIdUpdatesPostRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.UpdateWorkflowResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

getWorkflowExecutionTraceInfo

Get Workflow Execution Trace Info

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecutionTraceInfo({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecutionTraceInfo } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecutionTraceInfo.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecutionTraceInfo(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecutionTraceInfo failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionTraceInfoRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ExecutionTraceInfoResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

getWorkflowExecutionTraceOtel

Get Workflow Execution Trace Otel

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecutionTraceOtel({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecutionTraceOtel } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecutionTraceOtel.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecutionTraceOtel(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecutionTraceOtel failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionTraceOtelRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.WorkflowExecutionTraceOTelResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

getWorkflowExecutionTraceSummary

Get Workflow Execution Trace Summary

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecutionTraceSummary({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecutionTraceSummary } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecutionTraceSummary.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecutionTraceSummary(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecutionTraceSummary failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionTraceSummaryRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.WorkflowExecutionTraceSummaryResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

getWorkflowExecutionTraceEvents

Get Workflow Execution Trace Events

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecutionTraceEvents({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecutionTraceEvents } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecutionTraceEvents.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecutionTraceEvents(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecutionTraceEvents failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionTraceEventsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.WorkflowExecutionTraceEventsResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

stream

Stream

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.stream({
    executionId: "<id>",
  });

  for await (const event of result) {
    console.log(event);
  }
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsStream } from "@mistralai/mistralai/funcs/workflowsExecutionsStream.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsStream(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const event of result) {
    console.log(event);
  }
  } else {
    console.log("workflowsExecutionsStream failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.StreamV1WorkflowsExecutionsExecutionIdStreamGetRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<EventStream<operations.StreamV1WorkflowsExecutionsExecutionIdStreamGetResponseBody>>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

getWorkflowExecutionLogs

Retrieve logs for a workflow execution.

Use after/before/order on the first request to set the time range and sort order; for the next pages pass the cursor from the previous response (it remembers the range and order).

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.getWorkflowExecutionLogs({
    executionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsGetWorkflowExecutionLogs } from "@mistralai/mistralai/funcs/workflowsExecutionsGetWorkflowExecutionLogs.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsGetWorkflowExecutionLogs(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("workflowsExecutionsGetWorkflowExecutionLogs failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWorkflowExecutionLogsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ExecutionLogSearchResponse>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

streamWorkflowExecutionLogs

Stream logs for a workflow execution via SSE.

Resume cursor comes from the Last-Event-ID header or last_event_id query param (header wins) and takes precedence over after; omit all to tail from the execution start.

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.workflows.executions.streamWorkflowExecutionLogs({
    executionId: "<id>",
  });

  for await (const event of result) {
    console.log(event);
  }
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { workflowsExecutionsStreamWorkflowExecutionLogs } from "@mistralai/mistralai/funcs/workflowsExecutionsStreamWorkflowExecutionLogs.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await workflowsExecutionsStreamWorkflowExecutionLogs(mistral, {
    executionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const event of result) {
    console.log(event);
  }
  } else {
    console.log("workflowsExecutionsStreamWorkflowExecutionLogs failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.StreamWorkflowExecutionLogsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<EventStream<operations.StreamWorkflowExecutionLogsResponseBody>>

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*