# Activity execution - TypeScript SDK

> Shows how to perform Activity execution with the TypeScript SDK

## How to start an Activity Execution 

Calls to spawn [Activity Executions](/activity-execution) are written within a
[Workflow Definition](/workflow-definition). In TypeScript, you never call an Activity function directly. Instead, you
pass in the _types_ of your Activities and Activity options to the `proxyActivities` function. This will give you an
_Activity Handle_, a type-safe proxy object with the same function names and signatures as your real activities. From
the Activity Handle, you can call your Activities as if they were normal async functions.

```typescript
import { proxyActivities } from '@temporalio/workflow';
// Only import the activity types, not the functions themselves
import type * as activities from './activities';

// Retrieve the Activity Handle by passing in the Activity types and options
const activityHandle = proxyActivities<typeof activities>({
  startToCloseTimeout: '1 minute',
});

// Deconstruct the individual Activity functions from the Activity Handle
const { greet } = activityHandle;

// A workflow that calls an activity
export async function example(name: string): Promise<string> {
  return await greet(name);
}
```

When you call a proxied function, the Workflow does not execute the Activity code directly. Instead, it schedules an
Activity Task. After the Activity Task is scheduled, it becomes available for a Worker to pick up and execute. This
results in the set of three [Activity Task](/tasks#activity-task) related Events:
[ActivityTaskScheduled](/references/events#activitytaskscheduled),
[ActivityTaskStarted](/references/events#activitytaskstarted), and
[ActivityTaskCompleted](/references/events#activitytaskcompleted) in your Workflow Execution Event History.

The Worker may run many Activity executions at the same time, all using the same Activity function code. Temporal can
also retry an Activity if it fails or times out. For this reason, you should write Activities to be
[idempotent](/encyclopedia/activities/activity-definition.mdx#idempotency): calling them multiple times with the
same input should have the same effect as calling them once.
