- retrieve - Retrieve workflow step
Retrieves data for a specific step in a workflow
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.workflows.steps.retrieve("<id>", "<id>");
console.log(result);
}
run();The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { workflowsStepsRetrieve } from "@novu/api/funcs/workflowsStepsRetrieve.js";
// Use `NovuCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const novu = new NovuCore({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const res = await workflowsStepsRetrieve(novu, "<id>", "<id>");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("workflowsStepsRetrieve failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
workflowId |
string | ✔️ | N/A |
stepId |
string | ✔️ | N/A |
idempotencyKey |
string | ➖ | A header for idempotency purposes |
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. |
Promise<operations.WorkflowControllerGetWorkflowStepDataResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorDto | 414 | application/json |
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
| errors.ValidationErrorDto | 422 | application/json |
| errors.ErrorDto | 500 | application/json |
| errors.SDKError | 4XX, 5XX | */* |