# Workflow.sendEvent()
[EN] Source: https://mastra.ai/reference/workflows/workflow-methods/sendEvent

The `.sendEvent()` resumes execution when an event is sent.

## Usage example

```typescript copy
run.sendEvent("event-name", { value: "data" });
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "eventName",
      type: "string",
      description: "The name of the event to send",
      isOptional: false,
    },
    {
      name: "step",
      type: "Step",
      description: "The step to resume after the event is sent",
      isOptional: false,
    },
  ]}
/>

## Returns

<PropertiesTable
  content={[
    {
      name: "workflow",
      type: "Workflow",
      description: "The workflow instance for method chaining",
    },
  ]}
/>

## Extended usage example

```typescript showLineNumbers copy
import { mastra } from "./mastra";

const run = await mastra.getWorkflow("testWorkflow").createRunAsync();

const result = run.start({
  inputData: {
    value: "hello",
  },
});

setTimeout(() => {
  run.sendEvent("event-name", { value: "from event" });
}, 3000);
```

> In this example, avoid using `await run.start()` directly, as it would block sending the event before the workflow reaches its waiting state.

## Related

- [.waitForEvent()](./waitForEvent)
- [Suspend & Resume](/docs/workflows/suspend-and-resume#sleep--events)


---
title: "Reference: Workflow.sleep() | Workflows"
description: Documentation for the `Workflow.sleep()` method in workflows, which pauses execution for a specified number of milliseconds.
---