Skip to content

Commit

Permalink
React -> automate (#14185)
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdw committed Jun 20, 2024
1 parent c354c4a commit d680a31
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Prefect can schedule when to automatically create new flow runs bas

Prefect allows you to use schedules to automatically create new flow runs for deployments.

Prefect Cloud can schedule flow runs through event-driven [automations](/3.0rc/react/events/automations-triggers/).
Prefect Cloud can schedule flow runs through event-driven [automations](/3.0rc/automate/events/automations-triggers/).

<Tip>
**Support for multiple schedules**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Automations are a Prefect Cloud feature that enable you to configure [actions](#
[trigger](#triggers) conditions.

Potential triggers include the occurrence of events from changes in a flow run's state—or the absence of such events.
You can even define your own custom trigger to fire based on an [event](/3.0rc/react/events/) created from a
You can even define your own custom trigger to fire based on an [event](/3.0rc/automate/events/) created from a
webhook or a custom event defined in Python code.

Actions include starting flow runs, pausing schedules, and sending custom notifications.
Expand Down Expand Up @@ -152,7 +152,7 @@ creating automations that are linked to specific deployments to run them based o

Trigger definitions for deployments are supported in `prefect.yaml`, `.serve`, and `.deploy`. At deployment time,
specified trigger definitions create linked automations triggered by events matching your chosen
[grammar](/3.0rc/react/events/events/#event-grammar). Each trigger definition may include a [jinja template](https://en.wikipedia.org/wiki/Jinja_(template_engine))
[grammar](/3.0rc/automate/events/events/#event-grammar). Each trigger definition may include a [jinja template](https://en.wikipedia.org/wiki/Jinja_(template_engine))
to render the triggering `event` as the `parameters` of your deployment's flow run.

### Define triggers in `prefect.yaml`
Expand Down Expand Up @@ -846,6 +846,6 @@ deployments:

## See also

- To learn more about Prefect events, which can trigger automations, see the [events docs](/3.0rc/react/events/events/).
- See the [webhooks guide](/3.0rc/react/events/webhook-triggers/)
- To learn more about Prefect events, which can trigger automations, see the [events docs](/3.0rc/automate/events/events/).
- See the [webhooks guide](/3.0rc/automate/events/webhook-triggers/)
to learn how to create webhooks and receive external events.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Events can represent API calls, state transitions, or changes in your execution
Events power several features in Prefect Cloud, including flow run logs, audit logs, and automations.

Events enable observability into your data stack through the [event feed in the UI](#events-in-the-cloud-ui) and the
configuration of Prefect's reactivity through [automations](/3.0rc/react/events/automations-triggers/).
configuration of Prefect's reactivity through [automations](/3.0rc/automate/events/automations-triggers/).

## Event specification

Expand Down Expand Up @@ -67,14 +67,14 @@ To get data into an event for use in an automation action, specify a dictionary

### Emit events through webhooks

Prefect Cloud offers [programmable webhooks](/3.0rc/react/events/webhook-triggers/) to receive HTTP requests
Prefect Cloud offers [programmable webhooks](/3.0rc/automate/events/webhook-triggers/) to receive HTTP requests
from other systems and translate them into events within your workspace. Webhooks can emit
[pre-defined static events](/3.0rc/react/events/webhook-triggers/#static-webhook-events),
dynamic events that [use portions of the incoming HTTP request](/3.0rc/react/events/webhook-triggers/#dynamic-webhook-events),
or events derived from [CloudEvents](/3.0rc/react/events/webhook-triggers/#accepting-cloudevents).
[pre-defined static events](/3.0rc/automate/events/webhook-triggers/#static-webhook-events),
dynamic events that [use portions of the incoming HTTP request](/3.0rc/automate/events/webhook-triggers/#dynamic-webhook-events),
or events derived from [CloudEvents](/3.0rc/automate/events/webhook-triggers/#accepting-cloudevents).

Events emitted from any source appear in the event feed, where you can visualize activity in context and configure
[automations](/3.0rc/react/events/automations-triggers/) to react to the presence or absence of events in the future.
[automations](/3.0rc/automate/events/automations-triggers/) to react to the presence or absence of events in the future.

## Resources

Expand Down Expand Up @@ -129,10 +129,10 @@ resource, related resources, and its payload.

## Respond to events

From an event page, you can configure an [automation](/3.0rc/react/events/automations-triggers) to trigger on
From an event page, you can configure an [automation](/3.0rc/automate/events/automations-triggers) to trigger on
the observation of matching events—or a lack of matching events—by clicking the automate button in the overflow menu:

![Automation from event](/3.0rc/img/ui/automation-from-event.png)

The default trigger configuration fires every time it sees an event with a matching resource identifier. Advanced
configuration is possible through [custom triggers](/3.0rc/react/events/automations-triggers/).
configuration is possible through [custom triggers](/3.0rc/automate/events/automations-triggers/).
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Observe and respond to events from other systems.
Use webhooks in your Prefect Cloud workspace to receive, observe, and respond to events
from other systems in your ecosystem. Each webhook exposes a unique URL endpoint to
receive events from other systems and transforms them into Prefect
[events](/3.0rc/react/events/) for use in [automations](/3.0rc/react/events/automations-triggers/).
[events](/3.0rc/automate/events/) for use in [automations](/3.0rc/automate/events/automations-triggers/).

Webhooks are defined by two essential components: a unique URL and a template that translates incoming web requests to a
Prefect event.
Expand Down Expand Up @@ -109,7 +109,7 @@ Prefect Cloud workspace. The template you define for each webhook determines how
individual components of the incoming HTTP request become the event name and resource
labels of the resulting Prefect event.

As with the [templates available in Prefect Cloud Automation](/3.0rc/react/events/automations-triggers) for
As with the [templates available in Prefect Cloud Automation](/3.0rc/automate/events/automations-triggers) for
defining notifications and other parameters, you write templates in
[Jinja2](https://jinja.palletsprojects.com/en/3.1.x/templates/). All of the built-in
Jinja2 blocks and filters are available, as well as the filters from the
Expand Down Expand Up @@ -321,7 +321,7 @@ way tailored to your use case, use a dynamic template to interpret the incoming

The initial configuration of your webhook may require some trial and error as you get
the sender and your receiving webhook speaking a compatible language. While you are in
this phase, lean upon the [event feed](/3.0rc/react/events/#event-feed) in the UI to see events as they happen.
this phase, lean upon the [event feed](/3.0rc/automate/events/#event-feed) in the UI to see events as they happen.

When Prefect Cloud encounters an error during receipt of a webhook, it produces a
`prefect-cloud.webhook.failed` event in your workspace. This event includes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There are several ways to create an incident:

* **From a flow run, work pool, or block**, from the failed flow run, click the menu button and select "Declare an incident". This method automatically links the resource.

* **Through an [automation](/3.0rc/react/events/automations-triggers/)**, set up incident creation as an automated response to selected triggers.
* **Through an [automation](/3.0rc/automate/events/automations-triggers/)**, set up incident creation as an automated response to selected triggers.

### Automate an incident

Expand Down Expand Up @@ -63,7 +63,7 @@ To get started with incident automations, specify two fields in your trigger:
- `prefect-cloud.incident.resolved`
- `prefect-cloud.incident.updated.severity`

See [event triggers](/3.0rc/react/events/automations-triggers/#custom-triggers) for more information on custom triggers, and check out your event feed to see the event types emitted by your incidents and other resources (that is, the events that you can react to).
See [event triggers](/3.0rc/automate/events/automations-triggers/#custom-triggers) for more information on custom triggers, and check out your event feed to see the event types emitted by your incidents and other resources (that is, the events that you can react to).

When an incident is declared, any actions you configure such as pausing work pools or sending notifications, execute immediately.

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/3.0rc/deploy/serve-flows/deploy-a-flow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Attributes of a deployment include:
- **Tags**: optional text labels for organizing deployments

Some of the most common reasons to use an orchestration tool like Prefect are for
[scheduling](/3.0rc/deploy/serve-flows/add-schedules/) and [event-based triggering](/3.0rc/react/events/automations-triggers/).
[scheduling](/3.0rc/automate/add-schedules/) and [event-based triggering](/3.0rc/automate/events/automations-triggers/).
As opposed to manually triggering and managing flow runs, deploying a flow exposes an API and
UI that allow you to:

Expand Down Expand Up @@ -97,7 +97,7 @@ The `serve` method on flows exposes many options for the deployment. For more in
Here's how to use some of those options:

- `cron`: a keyword that allows you to set a cron string schedule for the deployment; see
[schedules](/3.0rc/deploy/serve-flows/add-schedules/) for more advanced scheduling options
[schedules](/3.0rc/automate/add-schedules/) for more advanced scheduling options
- `tags`: a keyword that allows you to tag this deployment and its runs for bookkeeping and filtering purposes
- `description`: a keyword that allows you to document what this deployment does; by default the
description is set from the docstring of the flow function (if documented)
Expand Down Expand Up @@ -271,12 +271,12 @@ scheduled with different values through parameters.

These are the fields to capture the required metadata for those actions:

- **`schedules`**: a list of [schedule objects](/3.0rc/deploy/serve-flows/add-schedules/).
- **`schedules`**: a list of [schedule objects](/3.0rc/automate/add-schedules/).
Most of the convenient interfaces for creating deployments allow users to avoid creating this object themselves.
For example, when [updating a deployment schedule in the UI](/3.0rc/deploy/serve-flows/add-schedules/#creating-schedules-through-the-ui)
For example, when [updating a deployment schedule in the UI](/3.0rc/automate/add-schedules/#creating-schedules-through-the-ui)
basic information such as a cron string or interval is all that's required.
- **`trigger`** (Cloud-only): triggers allow you to define event-based rules for running a deployment.
For more information see [Automations](/3.0rc/react/events/automations-triggers/).
For more information see [Automations](/3.0rc/automate/events/automations-triggers/).
- **`parameter_openapi_schema`**: an [OpenAPI compatible schema](https://swagger.io/specification/) that defines
the types and defaults for the flow's parameters.
This is used by the UI and the backend to expose options for creating manual runs as well as type validation.
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/deploy/work-pools/control-runs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ Otherwise, you can pass `image="my-image:latest"` to `deploy`.
## Next steps

The `cron` argument schedules the deployment to run at 1:00 AM every day.
See the [schedules](/3.0rc/deploy/serve-flows/add-schedules/) guide for more information on scheduling options.
See the [schedules](/3.0rc/automate/add-schedules/) guide for more information on scheduling options.

See the [Push Work Pool guide](/3.0rc/deploy/dynamic-infra/push-runs-serverless/) for more details and example commands for each
cloud provider.
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/deploy/work-pools/prefect-deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ These are fields you can add to each deployment declaration.
| `version` | An optional version for the deployment. |
| `tags` | A list of strings to assign to the deployment as tags. |
| <span class="no-wrap">`description`</span> | An optional description for the deployment. |
| `schedule` | An optional [schedule](/3.0rc/deploy/serve-flows/add-schedules) to assign to the deployment. Fields for this section are documented in the [Schedule Fields](#schedule-fields) section. |
| `schedule` | An optional [schedule](/3.0rc/automate/add-schedules) to assign to the deployment. Fields for this section are documented in the [Schedule Fields](#schedule-fields) section. |
| `triggers` | An optional array of [triggers](/3.0rc/deploy/serve-flows/#create-a-flow-run-with-an-event-trigger) to assign to the deployment |
| `entrypoint` | Required path to the `.py` file containing the flow you want to deploy (relative to the root directory of your development folder) combined with the name of the flow function. In the format `path/to/file.py:flow_function_name`. |
| `parameters` | Optional default values to provide for the parameters of the deployed flow. Should be an object with key/value pairs. |
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/develop/control-workflows/inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def get_shirt_order():

This code causes the flow run to continually pause until the user enters a valid age.

As an additional step, you can use an [automation](/3.0rc/react/events/automations-triggers) or
As an additional step, you can use an [automation](/3.0rc/automate/events/automations-triggers) or
[notification](/3.0rc/concepts/notifications/) to alert the user to the error.

## Send and receive input at runtime
Expand Down
6 changes: 3 additions & 3 deletions docs/3.0rc/get-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ It's the easiest way to transform any Python function into a unit of work that c

With Prefect you gain:

* [Scheduling](/3.0rc/deploy/serve-flows/add-schedules)
* [Scheduling](/3.0rc/automate/add-schedules)
* [Retries](/3.0rc/develop/write-tasks/index#task-arguments)
* [Logging](/3.0rc/develop/observe-workflows/logging/)
* [Convenient async functionality](/3.0rc/develop/write-tasks/task-runners/#task-runners)
* [Caching](/3.0rc/develop/write-tasks/index#caching)
* [Notifications](/3.0rc/react/events/automations-triggers/)
* [Notifications](/3.0rc/automate/events/automations-triggers/)
* [Observability](/3.0rc/develop/observe-workflows/index/)
* [Event-based orchestration](/3.0rc/react/events/webhook-triggers)
* [Event-based orchestration](/3.0rc/automate/events/webhook-triggers)

![screenshot of Prefect Cloud dashboard](/3.0rc/img/ui/cloud-dashboard.png)

Expand Down
10 changes: 5 additions & 5 deletions docs/3.0rc/manage/cloud/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ A workspace is an isolated environment within Prefect Cloud for all Prefect acti
- [Deployments](/3.0rc/deploy/serve-flows/)
- [Work pools](/3.0rc/deploy/work-pools/control-runs/)
- [Blocks](/3.0rc/develop/connect-third-party/)
- [Events](/3.0rc/react/events/)
- [Automations](/3.0rc/react/events/automations-triggers/)
- [Incidents](/3.0rc/react/events/events/)
- [Events](/3.0rc/automate/events/)
- [Automations](/3.0rc/automate/events/automations-triggers/)
- [Incidents](/3.0rc/automate/events/events/)

See the [Workspaces](/3.0rc/manage/cloud/workspaces/) page for more information about configuring and using workspaces.

## Incidents <span class="badge pro"></span> <span class="badge custom"></span>

Prefect Cloud's [incidents](/3.0rc/react/events/events/) help teams identify, rectify, and document issues in mission-critical workflows.
Prefect Cloud's [incidents](/3.0rc/automate/events/events/) help teams identify, rectify, and document issues in mission-critical workflows.
Incidents are formal declarations of disruptions to a workspace.
With [automations](/3.0rc/react/events/events/#incident-automations)), activity in that workspace can be paused when an incident is created and resumed when it is resolved.
With [automations](/3.0rc/automate/events/events/#incident-automations)), activity in that workspace can be paused when an incident is created and resumed when it is resolved.

## Error summaries

Expand Down
6 changes: 3 additions & 3 deletions docs/3.0rc/manage/self-host.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ either [Prefect Cloud](/3.0rc/manage/cloud/) or a self-hosted Prefect server, ba
Prefect Cloud and a self-hosted Prefect server instance share a common set of capabilities. Prefect Cloud has these additional features:

- [Workspaces](/3.0rc/manage/cloud/workspaces/): isolated environments to organize your flows, deployments, and flow runs
- [Automations](/3.0rc/react/events/automations-triggers/): configure triggers, actions, and
- [Automations](/3.0rc/automate/events/automations-triggers/): configure triggers, actions, and
notifications in response to real-time monitoring events
- [Email notifications](/3.0rc/react/events/automations-triggers/): send email alerts from Prefect's
- [Email notifications](/3.0rc/automate/events/automations-triggers/): send email alerts from Prefect's
servers based on automation triggers
- [Service accounts](/3.0rc/manage/cloud/manage-users/service-accounts/): configure API access for running workers or
executing flow runs on remote infrastructure
Expand Down Expand Up @@ -281,7 +281,7 @@ Prefect supports sending notifications through:
<Note>
**Notifications in Prefect Cloud**

Prefect Cloud uses the robust [Automations](/3.0rc/react/events/automations-triggers/) interface to
Prefect Cloud uses the robust [Automations](/3.0rc/automate/events/automations-triggers/) interface to
enable notifications related to flow run state changes and work pool status.
</Note>

Expand Down
24 changes: 9 additions & 15 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@
"version": "3.0rc",
"pages": [
"3.0rc/deploy/serve-flows/deploy-a-flow",
"3.0rc/deploy/serve-flows/serve-a-flow",
"3.0rc/deploy/serve-flows/add-schedules"
"3.0rc/deploy/serve-flows/serve-a-flow"
]
},
{
Expand Down Expand Up @@ -152,21 +151,16 @@
]
},
{
"group": "React",
"group": "Automate",
"version": "3.0rc",
"pages": [
{
"group": "Automate responses to events",
"version": "3.0rc",
"pages": [
"3.0rc/react/events/events",
"3.0rc/react/events/automations-triggers",
"3.0rc/react/events/custom-triggers",
"3.0rc/react/events/webhook-triggers"
]
},
"3.0rc/react/state-hooks",
"3.0rc/react/incidents"
"3.0rc/automate/add-schedules",
"3.0rc/automate/events/events",
"3.0rc/automate/events/automations-triggers",
"3.0rc/automate/events/custom-triggers",
"3.0rc/automate/events/webhook-triggers",
"3.0rc/automate/state-hooks",
"3.0rc/automate/incidents"
]
},
{
Expand Down

0 comments on commit d680a31

Please sign in to comment.