## Create/modify Workflow `client.Workflows.Update(ctx, workflowName, params) (*WorkflowUpdateResponse, error)` **put** `/accounts/{account_id}/workflows/{workflow_name}` Creates a new workflow or updates an existing workflow definition. ### Parameters - `workflowName string` - `params WorkflowUpdateParams` - `AccountID param.Field[string]` Path param - `ClassName param.Field[string]` Body param - `ScriptName param.Field[string]` Body param - `Limits param.Field[WorkflowUpdateParamsLimits]` Body param - `Steps int64` ### Returns - `type WorkflowUpdateResponse struct{…}` - `ID string` - `ClassName string` - `CreatedOn Time` - `IsDeleted float64` - `ModifiedOn Time` - `Name string` - `ScriptName string` - `TerminatorRunning float64` - `TriggeredOn Time` - `VersionID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/workflows" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) workflow, err := client.Workflows.Update( context.TODO(), "x", workflows.WorkflowUpdateParams{ AccountID: cloudflare.F("account_id"), ClassName: cloudflare.F("x"), ScriptName: cloudflare.F("x"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", workflow.ID) } ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "class_name": "class_name", "created_on": "2019-12-27T18:11:19.117Z", "is_deleted": 0, "modified_on": "2019-12-27T18:11:19.117Z", "name": "x", "script_name": "script_name", "terminator_running": 0, "triggered_on": "2019-12-27T18:11:19.117Z", "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "success": true, "result_info": { "count": 0, "per_page": 0, "total_count": 0, "cursor": "cursor", "page": 0 } } ```