> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapier.com/llms.txt
> Use this file to discover all available pages before exploring further.

# StatelessActionCreator

The `StatelessActionCreator` component can be used to create a new stateless action that you can use to run a stateless action.

## Props

### `onActionGenerated`

This callback will contain JSON that can be passed, along with instructions, to the [execute statless action](/ai-actions/how-tos/stateless/run-stateless-action) endpoint.

## Usage

<Warning>
  Make sure that this component is rendered unerneath an
  [`AiActionsProvider`](/ai-actions/libraries/react/ai-actions-provider)!
</Warning>

```tsx stateless-action-creator.tsx theme={null}
import { StatelessAction } from "@zapier/ai-actions";
import { StatelessActionCreator } from "@zapier/ai-actions-react";

export const StatelessActionCreatorExample = () => {
  return (
    <StatelessActionCreator
      onActionGenerated={(action: StatelessAction) => console.log(action)}
    />
  );
};
```

This JSON can then be used with [the Node.js client](/ai-actions/libraries/nodejs/getting-started) to execute a stateless action:

```ts execute-stateless-action.ts theme={null}
import { AiActions, StatelessAction } from "@zapier/ai-actions";

const aiActionsClient = new AiActions({
  auth: {
    apiKey: "sk-YOUR_API_KEY",
  },
});

const action: StatelessAction = {
  // JSON from the StatelessActionCreator
};

action.instructions =
  "Set the instructions you want to use when running the action";

const result = await aiActionsClient.executeStatelessAction(action, {
  // set this to `false` to actually run the action
  // otherwise, you can check the parameters that AI Actions will guess
  preview_only: true,
});

console.log(result);
```

## Example

[See the "Stateless action creator/runner" tool for a full example](/ai-actions/tools/stateless-action)
