Running workflow through a custom field in CRM Development

Please tell me if there is any way to start workflow through own button or toggle switch?

import React, { useState, useEffect } from 'react';
import {
 Button,
 Text,
 hubspot,
} from '@hubspot/ui-extensions';

hubspot.extend(({actions}) => (
 <Extension
 fetchProperties={actions.fetchCrmObjectProperties}
 />
));

const Extension = ({ fetchProperties }) => {
 const post = "https://api.hubapi.com/automation/v2/workflows/:workflowsID/enrollments/contacts/";
 const [email, setemail] = useState("");
 useEffect(() => {
 fetchProperties(["email"])
 .then(properties => {
 setemail(properties.email);
 });
 }, [fetchProperties]);

 function myOnClickFunction() {
 fetch(post + email, {
 method: 'POST',
 headers: {
 'Accept': 'application/json',
 'Authorization': 'Bearer TOKEN',
 'Content-Type': 'application/json',
 'Content-Length': '0',
 },
 });
}

 return (
 <><Text>Post:{email} </Text><Button onClick={myOnClickFunction}>Enroll</Button></>
 );

}

Hey, @VladislavGavrin :waving_hand: Can you tell us more about your project? Are you getting an error? Or is there another issue? Additionally, would this be for enrolling existing or net-new Contacts?

Thanks for the additional details. — Jaycee

Task: by clicking on the button, launch a workflow for a contact.
I want to enroll the contact in which the button was pressed