To use a script within a Workflow itself, it should be wrapped into a tool. To use a script to execute the Workflow (alone or along with other scripts you may have), use the API.
I hope this addressed your question, but let us know if you need more help. Jen, Galaxy team
If you only need a unix style 'filter' for your workflow (one input, one output, no parameters for your script), please check out the Tool Factory. If you need fixed or user configurable parameters and/or multiple input files, try the tool factory 2?
The Tool Factory (http://www.ncbi.nlm.nih.gov/pubmed/23024011) is a specialised Galaxy tool for running scripts (python/perl/bash/R) in Galaxy and (once they work with test data) creating a toolshed repository which can be uploaded into a tool shed to allow automated installation of the new tool (which runs the script) to any Galaxy for use in any workflow.
The entire script-to-running_tool process of converting an (trivial example) R script to use the BH procedure to 'adjust' some p values into a tool shed repository and then installing the generated tool from the toolshed back into Galaxy and then running it (NOT the tool factory this time but the newly installed freshly generated new tool!) is shown at
That video is > 2 years old, rushed and compresses a lot into less than 8 minutes so might be confusing at first. Worse, it keeps mentioning the test toolshed - please ignore that and use the main one. There are lots of steps, and it involves a development galaxy/toolshed on your own workstation so you are an admin...
The Tool Factory is available in two versions you can find on the main toolshed through the admin menu - search for 'factory' - there's the 'original' publication tool factory which is restricted to simple 'filter' style scripts (one input file, one output file..) and tool factory 2 which is a substantially more flexible version that allows specification of the R/perl/python dependency package to run for reproducible research, arbitrary numbers of input files and optional user editable parameters for your script. Be warned that the additonal flexibility comes at the price of increased complexity in parameter passing, but both versions of the tool factory offer example code in each scripting language on the tool form. A very complicated example of converting an R script into a tool developers can use to prepare some of the tool_dependency.xml required to find all the R/BioC package tarballs required as dependencies for a particular R/BioC library can be seen at https://wiki.galaxyproject.org/SetUpREnvironment
Neither version should be installed into any production Galaxy because unrestricted scripting is potentially a huge security hole - although only administrators can actually execute the tool factory and generated tools are secure (assuming the scripts themselves are secure!).
Bug reports and suggestions are welcomed - probably best to use the new git repo at https://github.com/galaxyproject/tools-iuc/issues