Training with machine_learning

Hello

I would like help please to run a ML through a workflow but i receive error message that i think is related to the pipe |>
(error message: The pipe operator requires a function call as RHS (:8:1)) that i replaced by %>%
but still receive other error messages. Below is an example that i would ask for help to correct with other ML like SVM, xgboost etc if you have suggestions. Thank you.

y <- rnorm(100, 7)
x1 <- rnorm(100, 6)
x2 <- rnorm(100, 8)

df <- data.frame(y, x1, x2)
df_split <- initial_split(df)
train_df <- training(df_split)
eq <- formula(y ~ x1 + x2)
rec1 <- recipe(eq, data = df) %>%
step_normalize(all_predictors())

model_1 <- gbm( distribution = "gaussian", n.tree=2, cv.folds=2 ) %>%
set_mode("regression") %>%
set_engine("gbm")
wf_1 <- workflow() %>%
add_recipe(rec1) %>%
add_model(model_1) %>%
fit(data = train_df)