# Function run priority <VersionBadge version="v3.2.1+" />
Source: https://www.inngest.com/docs/reference/functions/run-priority

You can prioritize specific function runs above other runs **within the same function**.

See the [Priority guide](/docs/guides/priority) for more information about how this feature works.

```ts
export default inngest.createFunction(
  {
    id: "ai-generate-summary",
    priority: {
      // For enterprise accounts, a given function run will be prioritized
      // ahead of functions that were enqueued up to 120 seconds ago.
      // For all other accounts, the function will run with no priority.
      run: "event.data.account_type == 'enterprise' ? 120 : 0",
    },
  },
  { event: "ai/summary.requested" },
  async ({ event, step }) => {
    // This function will be prioritized based on the account type
  }
);
```

## Configuration

<Properties>
  <Property name="priority" type="object">
    Options to configure how to prioritize functions

    <Properties nested={true}>
      <Property name="run" type="string">
        An expression which must return an integer between -600 and 600 (by default), with higher return
        values resulting in a higher priority.

        Expressions are defined using the Common Expression Language (CEL) with the original event accessible using dot-notation. Read [our guide to writing expressions](/docs/guides/writing-expressions) for more info. Examples:

        * Return the priority within an event directly: `event.data.priority` (where
	  `event.data.priority` is an int within your account's range)
        * Prioritize by a string field: `event.data.plan == 'enterprise' ? 180 : 0`
      </Property>
    </Properties>
  </Property>
</Properties>

<Callout>
  Return values outside of your account's range (by default, -600 to 600) will automatically be clipped
  to your max bounds.

  An invalid expression will evaluate to 0, as in "no priority".
</Callout>