Here are a couple examples from sites where I have implemented this. Both options are based on hyperlinks (but could be adapted to buttons) This first example shows how to do it directly.
I have a DVWP with this markup:
<a href="https://my.spsite.com/sites/submit/_layouts/NintexWorkflow/StartWorkflow.aspx?List=4f988f8a-336e-4154-b045-d083fa0371a1&ID={@ID}&TemplateID=%7Beefc705f-b3ad-43fb-9fc8-615fb1226955%7D&Source=https%3A%2F%2Fmy%2Espsite%2Ecom%2Fsites%2Fsubmit%2FPageLib%2FAdmin%2FDashboard%2Easpx">Copy Request</a>
It is calling a Nintex workflow in this case but it could be any workflow you've created. You can gather all the information by going to a list item and going into the manual initiation screen.
The other option I have a DVWP that has this code. On clicking the hyperlink, it executes some jQuery triggering my workflow. It uses Marc Anderson's SPServices library.
<xsl:attribute name="id">
<xsl:text>WorkflowTD</xsl:text>
<xsl:value-of select="@ID" disable-output-escaping="yes"/>
</xsl:attribute>
<a href="#">
<xsl:attribute name="onclick">
<xsl:text>javascript:StartWorkflow('https://</xsl:text>
<xsl:value-of select="$Host" />
<xsl:value-of select="@FileRef" disable-output-escaping="yes"/>
<xsl:text>','</xsl:text>
<xsl:value-of select="@ID" disable-output-escaping="yes"/>
<xsl:text>');</xsl:text>
</xsl:attribute>Copy Request</a>
Then I have a script that looks like this:
<script type="text/javascript">
function StartWorkflow(ItemURL, ItemID) {
var workflowGUID = null;
$().SPServices({
operation: "GetTemplatesForItem",
item: ItemURL,
async: false,
completefunc: function (xData, Status) {
$(xData.responseXML).find("WorkflowTemplates > WorkflowTemplate").each(function(i,e) {
// hard coded workflow name
if ( $(this).attr("Name") == "Copy" ) {
var guid = $(this).find("WorkflowTemplateIdSet").attr("TemplateId");
if ( guid != null ) {
workflowGUID = "{" + guid + "}";
}
}
});
}
});
var workflowTD = '#WorkflowTD' + ItemID;
$().SPServices({
operation: "StartWorkflow",
item: ItemURL,
templateId: workflowGUID,
workflowParameters: "<root />",
completefunc: function() {
$(workflowTD).html("Workflow Started");
}
});
}
</script>